/* Container Principal */
.pgs-container {
    max-width: 750px;
    margin: 2rem auto;
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(37, 99, 235, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Header */
.pgs-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pgs-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #2563eb;
    border-radius: 14px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.pgs-header-icon svg {
    width: 28px;
    height: 28px;
    color: #ffffff;
}

.pgs-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.4rem 0;
    line-height: 1.3;
}

.pgs-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

/* Display da Senha */
.pgs-password-display {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #ffffff;
    border: 2px solid #dbeafe;
    border-radius: 12px;
    padding: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pgs-password-display:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.pgs-password-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    padding: 0.5rem 0.75rem;
    outline: none;
    letter-spacing: 0.5px;
    min-width: 0;
}

.pgs-password-input::placeholder {
    color: #94a3b8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0;
}

/* Botões */
.pgs-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
    text-decoration: none;
}

.pgs-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.pgs-btn-copy {
    background: #2563eb;
    color: #ffffff;
}

.pgs-btn-copy:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pgs-btn-copy.copied {
    background: #16a34a;
}

.pgs-btn-refresh {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.pgs-btn-refresh:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

/* Indicador de Força */
.pgs-strength-section {
    margin-bottom: 1.5rem;
}

.pgs-strength-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.pgs-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

.pgs-strength-fill.very-weak {
    width: 20%;
    background: #ef4444;
}

.pgs-strength-fill.weak {
    width: 40%;
    background: #f59e0b;
}

.pgs-strength-fill.medium {
    width: 60%;
    background: #eab308;
}

.pgs-strength-fill.strong {
    width: 80%;
    background: #2563eb;
}

.pgs-strength-fill.very-strong {
    width: 100%;
    background: #16a34a;
}

.pgs-strength-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pgs-strength-text {
    font-size: 0.875rem;
    font-weight: 600;
}

.pgs-strength-text.very-weak { color: #ef4444; }
.pgs-strength-text.weak { color: #f59e0b; }
.pgs-strength-text.medium { color: #ca8a04; }
.pgs-strength-text.strong { color: #2563eb; }
.pgs-strength-text.very-strong { color: #16a34a; }

.pgs-strength-time {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Opções */
.pgs-options {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.pgs-option {
    margin-bottom: 1.25rem;
}

.pgs-option:last-child {
    margin-bottom: 0;
}

.pgs-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.pgs-option-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.pgs-option-icon {
    width: 20px;
    height: 20px;
    color: #2563eb;
}

.pgs-length-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 30px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0 0.5rem;
}

/* Range Slider */
.pgs-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #dbeafe;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.pgs-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #2563eb;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    transition: transform 0.15s ease;
}

.pgs-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.pgs-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2563eb;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.pgs-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* Grid de Checkboxes */
.pgs-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.pgs-checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.6rem;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.pgs-checkbox-option:hover {
    border-color: #93c5fd;
    background: #f8faff;
}

.pgs-checkbox-option.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.pgs-checkbox {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 2;
    margin: 0;
}

.pgs-checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.pgs-checkbox:checked ~ .pgs-checkbox-custom {
    background: #2563eb;
    border-color: #2563eb;
}

.pgs-checkbox:checked ~ .pgs-checkbox-custom::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -1px;
}

.pgs-checkbox-text {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    line-height: 1;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.pgs-checkbox-icon {
    font-weight: 700;
    color: #2563eb;
    font-size: 0.85rem;
}

/* Card Informativo */
.pgs-info-card {
    display: flex;
    align-items: center;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.pgs-info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.pgs-info-divider {
    width: 1px;
    height: 36px;
    background: #bfdbfe;
    margin: 0 1.25rem;
}

.pgs-info-icon {
    width: 24px;
    height: 24px;
    color: #2563eb;
    flex-shrink: 0;
}

.pgs-info-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pgs-info-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pgs-info-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

/* Histórico */
.pgs-history {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.pgs-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.pgs-history-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.pgs-history-icon {
    width: 20px;
    height: 20px;
    color: #2563eb;
}

.pgs-btn-clear {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pgs-btn-clear:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
}

.pgs-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 220px;
    overflow-y: auto;
}

.pgs-history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
    padding: 1rem;
    margin: 0;
}

.pgs-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.pgs-history-item:hover {
    border-color: #93c5fd;
}

.pgs-history-password {
    color: #1e293b;
    font-weight: 500;
}

.pgs-history-time {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.75rem;
    color: #94a3b8;
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Rodapé */
.pgs-security-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 0.75rem;
    text-align: center;
}

.pgs-security-footer svg {
    color: #16a34a;
    flex-shrink: 0;
}

/* Toast */
.pgs-toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: #2563eb;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    z-index: 9999;
    opacity: 0;
    transform: translateX(120%);
    transition: all 0.3s ease;
}

.pgs-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.pgs-toast.error {
    background: #ef4444;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

/* Animações */
@keyframes pgs-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.pgs-fade-in {
    animation: pgs-fade-in 0.25s ease;
}

/* Scrollbar do histórico */
.pgs-history-list::-webkit-scrollbar {
    width: 5px;
}

.pgs-history-list::-webkit-scrollbar-track {
    background: transparent;
}

.pgs-history-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Responsivo */
@media (max-width: 768px) {
    .pgs-container {
        margin: 1rem;
        padding: 1.25rem;
        border-radius: 12px;
    }
    
    .pgs-title {
        font-size: 1.3rem;
    }
    
    .pgs-password-display {
        flex-direction: column;
    }
    
    .pgs-password-input {
        font-size: 1rem;
        text-align: center;
    }
    
    .pgs-btn {
        justify-content: center;
    }
    
    .pgs-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pgs-info-card {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .pgs-info-divider {
        width: 100%;
        height: 1px;
        margin: 0;
    }
    
    .pgs-info-item {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .pgs-options-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .pgs-checkbox-option {
        padding: 0.6rem 0.5rem;
    }
    
    .pgs-checkbox-text {
        font-size: 0.75rem;
    }
}