/* =========================================
   PARPAY ACADEMY — Auth (login / signup)
   Reutiliza tokens de landing.css
   ========================================= */

.auth-shell {
    position: relative;
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    overflow: hidden;
}

.auth-shell__bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(7, 70, 115, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(7, 70, 115, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse at 50% 0%, rgba(0,0,0,1) 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, rgba(0,0,0,1) 0%, transparent 75%);
}

.auth-shell__spotlight {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 1100px;
    height: 700px;
    background: radial-gradient(ellipse at center, rgba(92, 200, 21, 0.18) 0%, transparent 60%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

.auth-shell__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
}

.auth-shell--wide .auth-shell__inner { max-width: 560px; }

/* ===== Card ===== */
.auth-card {
    background: var(--white);
    border: 1px solid rgba(7, 70, 115, 0.08);
    border-radius: var(--radius-lg);
    box-shadow:
        0 24px 64px rgba(5, 37, 62, 0.10),
        0 2px 8px rgba(7, 70, 115, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 40px 36px;
    animation: authFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.auth-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--green-50);
    border: 1px solid rgba(92, 200, 21, 0.25);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--green-700);
    margin-bottom: 20px;
}

.auth-card__badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--green-400);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(92, 200, 21, 0.2);
}

.auth-card__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ink-900);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 8px;
}

.auth-card__subtitle {
    font-size: 14.5px;
    color: var(--ink-500);
    margin-bottom: 28px;
}

.auth-card__subtitle a {
    color: var(--green-500);
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-card__subtitle a:hover { color: var(--green-700); }

/* ===== Form fields ===== */
.auth-field {
    position: relative;
    margin-bottom: 16px;
}

.auth-field__label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.auth-field__input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    background: var(--white);
    border: 1.5px solid var(--ink-100);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 16px;
    color: var(--ink-900);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.auth-field__input::placeholder { color: var(--ink-300); }

.auth-field__input:hover { border-color: var(--ink-200); }

.auth-field__input:focus {
    outline: none;
    border-color: var(--green-400);
    box-shadow: 0 0 0 4px rgba(92, 200, 21, 0.12);
    background: var(--white);
}

.auth-field__input.is-invalid,
.auth-field__input[aria-invalid="true"] {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.10);
}

.auth-field--password .auth-field__input { padding-right: 48px; }

.auth-field__toggle {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-400);
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.auth-field__toggle:hover {
    color: var(--green-500);
    background: var(--green-50);
}

.auth-field__hint {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--ink-400);
    line-height: 1.4;
}

.auth-field__error,
.invalid-feedback {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: #dc2626;
    font-weight: 500;
}

/* Bootstrap shim — manter compat com JS existente */
.invalid-feedback { display: none; }
.is-invalid ~ .invalid-feedback,
.invalid-feedback.d-block { display: block; }

/* ===== Checkbox ===== */
.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13.5px;
    color: var(--ink-500);
    line-height: 1.5;
}

.auth-check__input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    accent-color: var(--green-400);
    cursor: pointer;
}

.auth-check__label { cursor: pointer; }

.auth-check__label a {
    color: var(--green-500);
    font-weight: 600;
}
.auth-check__label a:hover { color: var(--green-700); }

.auth-terms-box {
    background: var(--ink-50);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.auth-terms-box .auth-check { margin-bottom: 0; }

/* ===== Submit button (reuses .btn .btn--primary .btn--block) ===== */
.auth-submit { margin-top: 8px; }

.auth-submit .btn--primary {
    padding: 16px 24px;
    font-size: 15px;
    width: 100%;
}

/* ===== Footer link below card ===== */
.auth-footer-link {
    text-align: center;
    margin-top: 24px;
    font-size: 13.5px;
    color: var(--ink-400);
}

.auth-footer-link a {
    color: var(--ink-500);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--ink-200);
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.auth-footer-link a:hover {
    color: var(--green-500);
    text-decoration-color: var(--green-400);
}

/* ===== Alerts ===== */
.auth-alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.auth-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.auth-alert--warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.auth-alert__icon { flex-shrink: 0; margin-top: 1px; }

/* ===== Password strength meter ===== */
.password-strength {
    margin: -4px 0 16px;
}
.password-strength .strength-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}
.password-strength .strength-meta span:first-child { color: var(--ink-400); }
.strength-bar {
    height: 4px;
    background: var(--ink-100);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}
.strength-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    border-radius: 100px;
    transition: width 0.3s ease, background 0.3s ease;
}
.strength-bar.strength-weak::after        { width: 25%; background: #ef4444; }
.strength-bar.strength-medium::after      { width: 55%; background: #f59e0b; }
.strength-bar.strength-strong::after      { width: 80%; background: var(--green-400); }
.strength-bar.strength-very-strong::after { width: 100%; background: var(--green-500); }

/* ===== Loading overlay ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 37, 62, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.loading-overlay.show { display: flex; }
.loading-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--green-400);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Subtle shake on invalid */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.shake { animation: shake 0.4s; }

/* ===== Responsive ===== */
@media (max-width: 560px) {
    .auth-shell { min-height: calc(100dvh - 64px); padding: 24px 16px max(32px, env(safe-area-inset-bottom)); align-items: flex-start; }
    .auth-card { padding: 28px 22px; border-radius: var(--radius-md); }
    .auth-card__title { font-size: 24px; }
    .auth-check { min-height: 44px; align-items: center; }
    .auth-card__subtitle a,
    .auth-check__label a,
    .auth-footer-link a {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
    }
    .auth-submit .btn--primary { min-height: 48px; }
}
