/* ==========================================================================
   TELA DE AUTENTICAÇÃO / LOGIN - CHICO BOLSO
   Estilos específicos para a página de login e autenticação
   ========================================================================== */

/* Layout Centralizado */
.auth-body {
    background: radial-gradient(circle at top, #e8f5e9 0%, #f8fafc 60%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Card Principal */
.auth-card {
    width: 100%;
    background-color: var(--white, #ffffff);
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    padding: 2.5rem 2rem;
    transition: var(--transition, all 0.3s ease);
}

.auth-card:hover {
    box-shadow: 0 25px 30px -5px rgba(18, 140, 126, 0.1), 0 10px 15px -6px rgba(0, 0, 0, 0.05);
}

/* Header do Card */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: inline-block;
    margin-bottom: 1.25rem;
    transition: var(--transition, all 0.3s ease);
}

.auth-logo:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.auth-logo .chico-logo-img {
    height: 52px;
    width: auto;
    display: block;
    object-fit: contain;
    margin: 0 auto;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark-slate, #0f172a);
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    line-height: 1.45;
}

/* Formulários e Inputs */
.auth-form,
.auth-form-secondary {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark-slate, #0f172a);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    margin-top: 0.2rem;
}

.forgot-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary, #128c7e);
    text-decoration: none;
    transition: var(--transition, all 0.3s ease);
}

.forgot-link:hover {
    color: var(--primary-hover, #0d6e63);
    text-decoration: underline;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: #94a3b8;
    font-size: 1.05rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    font-size: 0.95rem;
    border: 2px solid var(--border-color, #cbd5e1);
    border-radius: var(--radius-md, 10px);
    background-color: var(--white, #ffffff);
    color: var(--dark-slate, #0f172a);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.form-input:focus {
    border-color: var(--primary, #128c7e);
    box-shadow: 0 0 0 4px rgba(18, 140, 126, 0.12);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary, #128c7e);
}

.form-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Campo de senha com toggle */
.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition, all 0.3s ease);
    font-size: 1rem;
}

.toggle-password:hover {
    color: var(--primary, #128c7e);
}

/* Botões */
.auth-submit-btn,
.auth-secondary-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md, 10px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition, all 0.3s ease);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.auth-submit-btn {
    background-color: var(--primary, #128c7e);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(18, 140, 126, 0.25);
}

.auth-submit-btn:hover {
    background-color: var(--primary-hover, #0d6e63);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(18, 140, 126, 0.35);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-secondary-btn {
    background-color: transparent;
    border: 2px solid var(--border-color, #cbd5e1);
    color: var(--dark-slate, #0f172a);
}

.auth-secondary-btn:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-2px);
}

.auth-secondary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Divisória */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #94a3b8;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.auth-divider span {
    padding: 0 0.75rem;
    color: #94a3b8;
}

/* Rodapé do Card */
.auth-footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color, #f1f5f9);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
}

.auth-footer a {
    color: var(--primary, #128c7e);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition, all 0.3s ease);
}

.auth-footer a:hover {
    color: var(--primary-hover, #0d6e63);
    text-decoration: underline;
}

/* Botão de Voltar */
.back-home-link {
    color: var(--text-muted, #64748b);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition, all 0.3s ease);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full, 9999px);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-color, #e2e8f0);
}

.back-home-link:hover {
    color: var(--dark-slate, #0f172a);
    transform: translateX(-4px);
    background-color: var(--white, #ffffff);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
}

/* Alertas e mensagens de feedback */
.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md, 10px);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease;
}

.auth-alert.success {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.auth-alert.error {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.auth-alert.info {
    background-color: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner de carregamento */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status de validação dos campos */
.form-input.success {
    border-color: #22c55e;
    background-color: #f0fdf4;
}

.form-input.success:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.form-input.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-input.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

/* Mensagens de erro abaixo dos campos */
.field-error {
    font-size: 0.78rem;
    color: #ef4444;
    margin-top: 0.2rem;
    display: none;
}

.field-error.visible {
    display: block;
    animation: slideDown 0.3s ease;
}

/* ==========================================================================
   RESPONSIVIDADE
   ========================================================================== */

/* Tablets e telas médias */
@media (max-width: 768px) {
    .auth-container {
        max-width: 100%;
        padding: 0 0.5rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .auth-title {
        font-size: 1.3rem;
    }

    .auth-logo .chico-logo-img {
        height: 44px;
    }

    .form-input {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 0.9rem;
    }
}

/* Celulares e telas pequenas */
@media (max-width: 480px) {
    .auth-body {
        padding: 1rem 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: var(--radius-md, 12px);
    }

    .auth-header {
        margin-bottom: 1.5rem;
    }

    .auth-logo .chico-logo-img {
        height: 38px;
        margin-bottom: 0.75rem;
    }

    .auth-title {
        font-size: 1.1rem;
    }

    .auth-subtitle {
        font-size: 0.82rem;
    }

    .auth-form,
    .auth-form-secondary {
        gap: 1rem;
    }

    .form-input {
        padding: 0.7rem 0.9rem 0.7rem 2.2rem;
        font-size: 0.85rem;
        border-radius: var(--radius-sm, 8px);
    }

    .input-icon {
        left: 0.8rem;
        font-size: 0.9rem;
    }

    .auth-submit-btn,
    .auth-secondary-btn {
        padding: 0.7rem 1rem;
        font-size: 0.88rem;
        border-radius: var(--radius-sm, 8px);
    }

    .auth-divider {
        margin: 1rem 0;
        font-size: 0.7rem;
    }

    .auth-footer {
        margin-top: 1.25rem;
        padding-top: 1rem;
        font-size: 0.8rem;
    }

    .back-home-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .toggle-password {
        right: 0.8rem;
        font-size: 0.9rem;
    }

    .label-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .forgot-link {
        font-size: 0.75rem;
    }
}

/* Telas muito pequenas */
@media (max-width: 360px) {
    .auth-card {
        padding: 1.25rem 0.75rem;
    }

    .auth-title {
        font-size: 1rem;
    }

    .auth-logo .chico-logo-img {
        height: 32px;
    }

    .form-input {
        padding: 0.6rem 0.7rem 0.6rem 2rem;
        font-size: 0.8rem;
    }

    .auth-submit-btn,
    .auth-secondary-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.82rem;
    }
}

/* ==========================================================================
   TEMA ESCURO (OPCIONAL)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .auth-body {
        background: radial-gradient(circle at top, #1a2a2a 0%, #0f172a 60%);
    }

    .auth-card {
        background-color: #1e293b;
        border-color: #334155;
    }

    .auth-title {
        color: #f1f5f9;
    }

    .auth-subtitle {
        color: #94a3b8;
    }

    .form-label {
        color: #e2e8f0;
    }

    .form-input {
        background-color: #0f172a;
        border-color: #334155;
        color: #f1f5f9;
    }

    .form-input::placeholder {
        color: #64748b;
    }

    .form-input:focus {
        border-color: var(--primary, #128c7e);
        box-shadow: 0 0 0 4px rgba(18, 140, 126, 0.2);
    }

    .input-icon {
        color: #64748b;
    }

    .auth-divider {
        color: #64748b;
    }

    .auth-divider::before,
    .auth-divider::after {
        border-color: #334155;
    }

    .auth-footer {
        border-color: #334155;
        color: #94a3b8;
    }

    .back-home-link {
        background-color: rgba(30, 41, 59, 0.8);
        border-color: #334155;
        color: #94a3b8;
    }

    .back-home-link:hover {
        background-color: #1e293b;
        color: #f1f5f9;
    }

    .forgot-link {
        color: #34d399;
    }

    .forgot-link:hover {
        color: #6ee7b7;
    }

    .auth-secondary-btn {
        border-color: #334155;
        color: #e2e8f0;
    }

    .auth-secondary-btn:hover {
        background-color: #1e293b;
        border-color: #475569;
    }
}