/* ============================================================
   AUTH PAGES • NousCard (Login, Registro, Recuperação)
   Compatível com base.html e acessibilidade
============================================================ */

/* Corpo das páginas de auth */
body.nc-login-body {
    margin: 0;
    padding: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Caixa de login/registro */
.nc-login-box {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Títulos */
.nc-login-box h2 {
    margin: 0 0 1.5rem 0;
    color: #1a1a2e;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
}

/* Grupos de formulário */
.nc-form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.nc-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.nc-form-label .nc-required {
    color: #e53e3e;
    margin-left: 2px;
}

/* Inputs */
.nc-form-input,
.nc-login-box input[type="email"],
.nc-login-box input[type="password"],
.nc-login-box input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    box-sizing: border-box;
}

.nc-form-input:focus,
.nc-login-box input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.nc-form-input[aria-invalid="true"],
.nc-login-box input[aria-invalid="true"] {
    border-color: #e53e3e;
}

.nc-form-input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
}

/* Mensagens de erro */
.nc-field-error {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: #e53e3e;
    font-weight: 500;
}

.nc-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nc-error [aria-hidden="true"] {
    font-size: 1.1rem;
}

/* Hint text */
.nc-form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: #718096;
}

/* Checkbox */
.nc-form-group-checkbox {
    margin: 1rem 0;
}

.nc-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.nc-checkbox-wrapper input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 1.125rem;
    height: 1.125rem;
    accent-color: #667eea;
    cursor: pointer;
}

.nc-checkbox-label {
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    line-height: 1.4;
}

.nc-checkbox-label a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.nc-checkbox-label a:hover {
    text-decoration: underline;
}

/* Botões */
.nc-btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.nc-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.nc-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.nc-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading state no botão */
.nc-btn-primary .btn-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.nc-btn-primary:disabled .btn-text {
    display: none;
}

.nc-btn-primary:disabled .btn-loading {
    display: inline-flex;
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Links de ajuda */
.nc-login-forgot,
.nc-login-register {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: #4a5568;
}

.nc-login-forgot a,
.nc-login-register a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.nc-login-forgot a:hover,
.nc-login-register a:hover {
    text-decoration: underline;
}

/* Password toggle */
.nc-password-wrapper {
    position: relative;
}

.nc-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 4px;
    color: #718096;
    transition: color 0.2s;
    border-radius: 4px;
}

.nc-toggle-password:hover {
    color: #4a5568;
    background: #f7fafc;
}

.nc-toggle-password:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Requisitos de senha */
.nc-password-requirements {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.nc-password-requirements small {
    display: block;
    margin-bottom: 0.375rem;
    color: #4a5568;
    font-weight: 500;
}

.nc-password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    color: #718096;
}

.nc-password-requirements li {
    padding: 0.125rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nc-password-requirements li.valid {
    color: #38a169;
}

.nc-password-requirements li.valid::before {
    content: "✓";
    font-weight: bold;
}

/* Responsividade */
@media (max-width: 480px) {
    .nc-login-box {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
    
    .nc-login-box h2 {
        font-size: 1.5rem;
    }
}

/* Reduzir motion para usuários que preferem */
@media (prefers-reduced-motion: reduce) {
    .nc-login-box,
    .nc-btn-primary,
    .spinner {
        animation: none !important;
        transition: none !important;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .nc-form-input,
    .nc-login-box input {
        border-width: 3px;
    }
    
    .nc-btn-primary {
        border: 2px solid #000;
    }
}
