/* ============================================================
   TMS Auth Pages — v2.0  (cadastro / recuperação / redefinição)
   Design alinhado ao login-page.css (split-screen palette)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ap-brand-from:  #0f172a;
    --ap-brand-to:    #1e2d5e;
    --ap-primary:     var(--primary-color, #2563eb);
    --ap-primary-dk:  var(--primary-dark,  #1d4ed8);
    --ap-primary-lt:  var(--primary-light, #60a5fa);
    --ap-text:        #1e293b;
    --ap-muted:       #64748b;
    --ap-border:      #e2e8f0;
    --ap-input-bg:    #f8fafc;
    --ap-radius:      12px;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(160deg, var(--ap-brand-from) 0%, var(--ap-brand-to) 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Decorative dot texture over the bg */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

/* Blobs */
body::after {
    content: '';
    position: fixed;
    width: 480px; height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,.18) 0%, transparent 70%);
    top: -120px; right: -120px;
    pointer-events: none;
    z-index: 0;
}

/* ── Page wrapper ──────────────────────────────────────────── */
.ap-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

/* ── Card ──────────────────────────────────────────────────── */
.ap-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0,0,0,.22), 0 4px 16px rgba(0,0,0,.12);
    overflow: hidden;
    animation: ap-slide-up .45s cubic-bezier(.4,0,.2,1);
}

@keyframes ap-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Card header strip */
.ap-card-header {
    background: linear-gradient(160deg, var(--ap-brand-from) 0%, var(--ap-brand-to) 100%);
    padding: 1.75rem 2rem 1.5rem;
    position: relative;
    overflow: hidden;
}
.ap-card-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.ap-header-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ap-logo-box {
    width: 48px; height: 48px;
    background: rgba(255,255,255,.95);
    border: 1.5px solid rgba(255,255,255,.4);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    padding: 6px;
    flex-shrink: 0;
}
.ap-logo-box img {
    width: 100%; height: 100%;
    object-fit: contain;
}

.ap-header-text .ap-brand-name {
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.ap-header-text .ap-brand-sub {
    font-size: .68rem;
    color: rgba(255,255,255,.5);
    margin-top: .1rem;
}

/* ── Card body ─────────────────────────────────────────────── */
.ap-card-body {
    padding: 1.75rem 2rem 2rem;
}

/* Page heading */
.ap-heading {
    margin-bottom: 1.5rem;
}
.ap-heading h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ap-text);
    letter-spacing: -.3px;
    margin-bottom: .25rem;
}
.ap-heading p {
    font-size: .8125rem;
    color: var(--ap-muted);
    line-height: 1.5;
}

/* Alert */
.ap-alert {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    border-radius: 8px;
    padding: .65rem .85rem;
    margin-bottom: 1.25rem;
    font-size: .8rem;
    font-weight: 500;
    line-height: 1.4;
}
.ap-alert.error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-left: 3px solid #ef4444;
    color: #991b1b;
}
.ap-alert.success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-left: 3px solid #10b981;
    color: #065f46;
}
.ap-alert.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 3px solid #3b82f6;
    color: #1e40af;
}
.ap-alert i { font-size: .8rem; flex-shrink: 0; margin-top: .1rem; }

/* Fields */
.ap-field { margin-bottom: 1rem; }

.ap-label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    color: var(--ap-text);
    letter-spacing: .1px;
    margin-bottom: .35rem;
}

.ap-input-wrap { position: relative; }

.ap-input-icon {
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ap-muted);
    font-size: .8rem;
    pointer-events: none;
    transition: color .2s;
}

.ap-input {
    width: 100%;
    background: var(--ap-input-bg);
    border: 1.5px solid var(--ap-border);
    border-radius: 9px;
    padding: .7rem .875rem .7rem 2.35rem;
    font-size: .875rem;
    color: var(--ap-text);
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s, background .2s;
    line-height: 1.4;
}
.ap-input.no-icon { padding-left: .875rem; }
.ap-input:hover { border-color: #cbd5e1; }
.ap-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--ap-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.11);
}
.ap-input:focus ~ .ap-input-icon,
.ap-input-wrap:focus-within .ap-input-icon { color: var(--ap-primary); }
.ap-input::placeholder { color: #94a3b8; }

/* Password toggle */
.ap-pwd-toggle {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ap-muted);
    font-size: .8rem;
    padding: .25rem;
    line-height: 1;
    border-radius: 4px;
    transition: color .2s;
}
.ap-pwd-toggle:hover { color: var(--ap-primary); }

/* Code input (6-digit verification) */
.ap-code-input {
    width: 100%;
    background: var(--ap-input-bg);
    border: 1.5px solid var(--ap-border);
    border-radius: 9px;
    padding: .85rem .875rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .35em;
    text-align: center;
    color: var(--ap-text);
    font-family: 'Courier New', monospace;
    transition: border-color .2s, box-shadow .2s;
}
.ap-code-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--ap-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.11);
}
.ap-code-input::placeholder { letter-spacing: .2em; color: #cbd5e1; font-size: 1.1rem; }

/* Submit */
.ap-submit {
    width: 100%;
    background: var(--ap-primary);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: .8rem 1.25rem;
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 1.4rem;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 10px rgba(37,99,235,.28);
    position: relative;
    overflow: hidden;
}
.ap-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.1) 0%, transparent 100%);
    pointer-events: none;
}
.ap-submit:hover {
    background: var(--ap-primary-dk);
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(37,99,235,.36);
}
.ap-submit:active { transform: translateY(0); }
.ap-submit:disabled { opacity: .65; cursor: not-allowed; transform: none !important; }

/* Info box */
.ap-info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-left: 3px solid var(--ap-primary-lt);
    border-radius: 9px;
    padding: .85rem 1rem;
    margin-bottom: 1.1rem;
}
.ap-info-box .ap-info-title {
    font-size: .75rem;
    font-weight: 700;
    color: var(--ap-text);
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .3rem;
}
.ap-info-box .ap-info-title i { color: var(--ap-primary); font-size: .75rem; }
.ap-info-box p {
    font-size: .76rem;
    color: var(--ap-muted);
    line-height: 1.45;
    margin: 0;
}

/* Email display box */
.ap-email-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: .3rem .75rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--ap-primary-dk);
    margin-bottom: 1.1rem;
}
.ap-email-pill i { font-size: .75rem; }

/* Countdown */
.ap-countdown {
    text-align: center;
    font-size: .75rem;
    color: var(--ap-muted);
    margin-top: .6rem;
}
.ap-countdown strong { color: var(--ap-text); }

/* Resend link */
.ap-resend {
    display: block;
    text-align: center;
    margin-top: .5rem;
    font-size: .76rem;
    color: var(--ap-muted);
}
.ap-resend a {
    color: var(--ap-primary);
    text-decoration: none;
    font-weight: 600;
}
.ap-resend a:hover { text-decoration: underline; }

/* Success state */
.ap-success-box {
    text-align: center;
    padding: .5rem 0 .25rem;
}
.ap-success-icon {
    width: 60px; height: 60px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto .85rem;
    font-size: 1.4rem;
    color: #059669;
}
.ap-success-box h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ap-text);
    margin-bottom: .4rem;
}
.ap-success-box p {
    font-size: .8125rem;
    color: var(--ap-muted);
    line-height: 1.5;
    margin: 0;
}

/* Conclusion info list */
.ap-conclusion-list {
    background: #f8fafc;
    border: 1px solid var(--ap-border);
    border-radius: 9px;
    padding: .75rem 1rem;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.ap-conclusion-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .78rem;
    color: var(--ap-text);
}
.ap-conclusion-item i {
    font-size: .75rem;
    color: var(--ap-primary-lt);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

/* Footer links */
.ap-footer {
    text-align: center;
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--ap-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.ap-footer a {
    font-size: .76rem;
    color: var(--ap-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    transition: color .2s;
}
.ap-footer a:hover { color: var(--ap-primary); }
.ap-footer i { font-size: .7rem; }

/* Divider */
.ap-divider {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 1.2rem 0;
    color: #cbd5e1;
    font-size: .7rem;
}
.ap-divider::before, .ap-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ap-border);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
    .ap-page { padding: 1.25rem .75rem; align-items: flex-start; padding-top: 1.5rem; }
    .ap-card { border-radius: 14px; }
    .ap-card-header { padding: 1.4rem 1.5rem 1.2rem; }
    .ap-card-body { padding: 1.4rem 1.5rem 1.5rem; }
    .ap-heading h1 { font-size: 1.1rem; }
}
