/* ============================================================
   Auth · Rotoline Dashboard (split 50/50 — replica PortalCliente)
   Adaptado de PortalCliente/customers/templates/auth/_partials/auth_styles.html
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #0f172a;
    background: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
}

/* ============ LEFT PANEL (PHOTO) ============ */
.lp { position: relative; overflow: hidden; background: #0a1628; color: #fff; display: flex; flex-direction: column; }
.lp-photo { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.lp-overlay {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(135deg,
        rgba(4, 60, 114, 0.78) 0%,
        rgba(4, 60, 114, 0.55) 35%,
        rgba(10, 22, 40, 0.78) 100%);
}
.lp-grid-bg {
    position: absolute; inset: 0; z-index: 3; opacity: .35; pointer-events: none;
    background-image:
        linear-gradient(rgba(110,193,228,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110,193,228,0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 60%, black 30%, transparent 80%);
            mask-image: radial-gradient(ellipse at 30% 60%, black 30%, transparent 80%);
}
.lp-content { position: relative; z-index: 4; height: 100%; padding: 40px 48px; display: flex; flex-direction: column; }
.lp-logo { display: flex; align-items: center; gap: 12px; }
.lp-logo-mark {
    width: 40px; height: 40px; border-radius: 10px;
    background: #fff; color: #043c72;
    display: flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 18px; letter-spacing: -1px;
}
.lp-logo-name { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.lp-logo-caption { font-size: 11px; opacity: .75; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.6px; text-transform: uppercase; }
.lp-hero { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 32px; max-width: 580px; }
.lp-tag {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 12px; border-radius: 8px;
    background: rgba(0,0,0,0.40); border: 1px solid rgba(110,193,228,0.30);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    font-size: 11px; font-weight: 600; color: #9bd5ee;
    font-family: 'JetBrains Mono', monospace; letter-spacing: 0.6px; text-transform: uppercase;
    align-self: flex-start; margin-bottom: 24px;
}
.lp-tag-dot { width: 6px; height: 6px; border-radius: 99px; background: #0ab720; box-shadow: 0 0 8px #0ab720; }
.lp-h1 {
    font-size: 48px; font-weight: 700; line-height: 1.05; letter-spacing: -1px; margin: 0;
    text-shadow: 0 2px 24px rgba(0,0,0,0.40);
}
.lp-h1 b { color: #6EC1E4; font-weight: 700; }
.lp-sub {
    font-size: 16px; line-height: 1.6; opacity: .88; margin-top: 18px;
    max-width: 480px; text-shadow: 0 1px 12px rgba(0,0,0,0.40);
}
.lp-trust {
    display: flex; align-items: center; gap: 28px;
    margin-top: 32px; padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.18);
}
.lp-stat-value {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 22px; font-weight: 700; color: #fff;
    font-family: 'JetBrains Mono', monospace; letter-spacing: -0.5px;
}
.lp-stat-dot { width: 8px; height: 8px; border-radius: 99px; background: #0ab720; box-shadow: 0 0 8px #0ab720; }
.lp-stat-label {
    font-size: 11px; color: rgba(255,255,255,0.65);
    text-transform: uppercase; letter-spacing: 0.6px; font-weight: 500; margin-top: 2px;
}

/* ============ RIGHT PANEL ============ */
.rp { position: relative; background: #fff; display: flex; flex-direction: column; padding: 28px 56px; }
.rp-top { display: flex; justify-content: space-between; align-items: center; }
.lang-switcher {
    display: inline-flex; background: #f1f5f9;
    padding: 3px; border-radius: 999px; gap: 2px; align-items: center; margin: 0;
}
.lang-switcher .bx-globe { font-size: 16px; color: #64748b; margin-left: 8px; margin-right: 2px; }
.lang-switcher button {
    padding: 5px 12px; font-size: 12px; font-weight: 600;
    background: transparent; color: #64748b;
    border: none; border-radius: 999px; cursor: pointer;
    font-family: 'JetBrains Mono', monospace; letter-spacing: 0.4px;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.lang-switcher button.is-active { background: #fff; color: #043c72; box-shadow: 0 1px 2px rgba(15,23,42,0.06); }
.lang-switcher button:hover:not(.is-active) { color: #1e293b; }
.rp-help { font-size: 13px; color: #64748b; display: inline-flex; align-items: center; gap: 6px; transition: color 150ms; }
.rp-help:hover { color: #043c72; }

.rp-form {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    max-width: 420px; width: 100%; align-self: center; padding: 32px 0;
}
.rp-eyebrow {
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
    color: #0369a1; letter-spacing: 1.2px; text-transform: uppercase;
    margin-bottom: 12px; display: inline-flex; align-items: center; gap: 8px;
}
.rp-eyebrow::before { content: ''; width: 24px; height: 1px; background: #6EC1E4; }
.rp-h1 { font-size: 32px; font-weight: 700; color: #0f172a; margin: 0 0 8px; letter-spacing: -0.5px; line-height: 1.15; }
.rp-subtitle { font-size: 14px; color: #64748b; margin: 0 0 28px; line-height: 1.5; }
.rp-subtitle b { font-weight: 600; color: #1e293b; font-family: 'JetBrains Mono', monospace; font-size: 13px; }

/* SSO buttons */
.sso-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.sso-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: 48px; padding: 0 16px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; font-weight: 500; color: #1e293b;
    font-family: 'Inter', sans-serif; cursor: pointer;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.sso-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.sso-btn .bxl-microsoft { font-size: 18px; color: #00a4ef; }

/* Divider */
.or-divider {
    display: flex; align-items: center; gap: 12px;
    font-size: 11px; color: #94a3b8; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.8px;
    font-family: 'JetBrains Mono', monospace;
}
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

/* Form field */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 600; color: #1e293b; letter-spacing: 0.1px; }
.field-help { font-size: 12px; color: #64748b; line-height: 1.4; margin-top: 2px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .bx { position: absolute; color: #94a3b8; font-size: 18px; transition: color 150ms; pointer-events: none; }
.input-wrap > .bx.icon-left { left: 14px; }
.input-wrap > .toggle-pw { right: 14px; cursor: pointer; pointer-events: auto; color: #94a3b8; }
.input-wrap > .toggle-pw:hover { color: #043c72; }
.input-field {
    width: 100%; height: 48px;
    padding: 0 16px 0 42px;
    border: 1px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; color: #334155; background: #fff;
    outline: none; font-family: 'Inter', sans-serif;
    transition: border-color 150ms, box-shadow 150ms;
}
.input-field.has-right-icon { padding-right: 42px; }
.input-field::placeholder { color: #94a3b8; }
.input-field:focus { border-color: #6EC1E4; box-shadow: 0 0 0 4px rgba(110,193,228,0.20); }
.input-wrap:focus-within > .bx.icon-left { color: #043c72; }

/* Buttons */
.btn-primary {
    width: 100%; height: 48px; padding: 0 16px;
    background: #043c72; color: #fff; border: none; border-radius: 10px;
    font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background 150ms, transform 150ms;
    text-decoration: none;
}
.btn-primary:hover { background: #032d56; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary .bx { font-size: 18px; }

.btn-secondary-sm {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 12px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: #043c72;
    cursor: pointer; transition: all 150ms; white-space: nowrap;
    text-decoration: none;
}
.btn-secondary-sm:hover { background: #f1f5f9; border-color: #cbd5e1; }
.btn-secondary-sm .bx { font-size: 14px; }

/* Step badge (success/warning/info) */
.step-card {
    margin-top: 20px; padding: 14px 16px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
    display: flex; align-items: flex-start; gap: 12px;
}
.step-card-icon {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    background: rgba(4,60,114,0.08); color: #043c72;
}
.step-card.is-success .step-card-icon { background: rgba(10,183,32,0.10); color: #0ab720; }
.step-card.is-warning .step-card-icon { background: rgba(245,158,11,0.12); color: #d97706; }
.step-card-title { font-size: 13px; font-weight: 600; color: #1e293b; }
.step-card-sub { font-size: 12px; color: #64748b; margin-top: 2px; line-height: 1.45; }

.link-back {
    background: none; border: none; padding: 0;
    font-size: 13px; color: #64748b; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    align-self: flex-start; font-family: 'Inter', sans-serif;
    transition: color 150ms; text-decoration: none;
}
.link-back:hover { color: #043c72; }

/* Footer */
.rp-footer {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; color: #94a3b8;
    font-family: 'JetBrains Mono', monospace; letter-spacing: 0.4px;
}
.rp-footer .links { display: flex; gap: 16px; }
.rp-footer .links a:hover { color: #64748b; }

/* Messages */
.msg-stack { display: flex; flex-direction: column; gap: 8px; }
.msg {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 12px; border-radius: 10px;
    font-size: 13px; line-height: 1.4; border: 1px solid;
}
.msg .bx { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.msg.is-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.msg.is-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.msg.is-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.msg.is-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* Password row (login passo 2) */
.password-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.check-keep {
    display: inline-flex; align-items: center; gap: 8px;
    color: #475569; cursor: pointer; user-select: none;
}
.check-keep input { accent-color: #043c72; width: 14px; height: 14px; cursor: pointer; }
.link-forgot { color: #043c72; font-weight: 500; transition: color 150ms; }
.link-forgot:hover { color: #032d56; text-decoration: underline; }

/* Login extras */
.email-form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.signup-nudge {
    margin-top: 32px; padding: 14px 16px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.signup-nudge-title { font-size: 13px; font-weight: 600; color: #1e293b; }
.signup-nudge-sub { font-size: 12px; color: #64748b; margin-top: 2px; }

/* Reset confirm/complete: estilizar inputs raw do Django */
.rp .input-wrap input[type="email"],
.rp .input-wrap input[type="password"],
.rp .input-wrap input[type="text"] {
    width: 100%; height: 48px;
    padding: 0 16px 0 42px;
    border: 1px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; color: #334155; background: #fff;
    outline: none; font-family: 'Inter', sans-serif;
    transition: border-color 150ms, box-shadow 150ms;
}
.rp .input-wrap input[type="email"]::placeholder,
.rp .input-wrap input[type="password"]::placeholder,
.rp .input-wrap input[type="text"]::placeholder { color: #94a3b8; }
.rp .input-wrap input[type="email"]:focus,
.rp .input-wrap input[type="password"]:focus,
.rp .input-wrap input[type="text"]:focus { border-color: #6EC1E4; box-shadow: 0 0 0 4px rgba(110,193,228,0.20); }

/* Responsive */
@media (max-width: 1024px) {
    .rp { padding: 28px 36px; }
    .lp-content { padding: 36px 36px; }
    .lp-h1 { font-size: 38px; }
}
@media (max-width: 960px) {
    .login-shell { grid-template-columns: 1fr; }
    .lp { display: none; }
    .rp { padding: 32px 24px; min-height: 100vh; }
    .rp-form { padding: 24px 0; }
}
@media (max-width: 480px) {
    .rp { padding: 24px 16px; }
    .rp-h1 { font-size: 26px; }
    .rp-footer { flex-direction: column; gap: 8px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .lp-tag-dot, .lp-stat-dot { box-shadow: none; }
}
