:root {
    --bg: #0f172a;
    --panel: #111827;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --accent: #10b981;
    --danger: #ef4444;
    --login-card-w: 420px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, Segoe UI, Arial, sans-serif; }
html { font-size: clamp(14px, 1vw, 16px); }

.hero { position: relative; min-height: 100dvh; background: #0b1220 url("../images/lotes-bg.jpg") center / cover no-repeat; }
.login-center { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 100dvh; padding: 24px; width: 100%; overflow: auto; }
.login-card { position: relative; width: var(--login-card-w, 520px); background: rgba(255, 255, 255, .96); color: #0f172a; border-radius: 14px; padding: 20px; border: 1px solid #e5e7eb; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.login-avatar { width: 72px; height: 72px; border-radius: 50%; border: 3px solid #e5e7eb; background: #fff; display: flex; align-items: center; justify-content: center; margin: 8px auto 12px; overflow: hidden; }
.login-avatar img { width: 64px; height: 64px; object-fit: contain; }
.login-title { text-align: center; margin: 0 0 12px; font-size: 1.5em; }
.login-logo { position: absolute; top: 14px; left: 14px; width: 72px; height: auto; z-index: 1; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.license-box { margin-top: 10px; width: var(--login-card-w, 420px); background: #fff; color: #0f172a; padding: 8px 12px; border-radius: 12px; border: 1px solid #e5e7eb; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.login-footer { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); background: #fff; color: #0f172a; padding: 10px 16px; border-radius: 12px; border: 1px solid #e5e7eb; font-size: 12px; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); width: var(--login-card-w, 420px); }
.login-footer .lf-title { font-weight: 700; margin-bottom: 4px; }
.login-footer .lf-sub { opacity: .9; }
.login-footer .lf-contact { display: flex; align-items: center; justify-content: space-evenly; padding: 0 16px; margin: 4px 0; transform: translateX(-8px); }
.login-footer .lf-contact a { color: #0f766e; text-decoration: none; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 120px; }
.login-footer .lf-contact a:hover { text-decoration: underline; }
.login-footer .lf-contact .sep { opacity: .5; }
.login-footer .lf-contact .contact-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(15, 118, 110, .12); color: #0f766e; }
.login-footer .lf-contact .contact-icon img { max-width: 100%; max-height: 100%; }
.login-footer .lf-contact .contact-icon svg { display: block; }
.login-footer .lf-contact .contact-text { line-height: 1; }

.login-progress { position: absolute; top: 0; left: 0; right: 0; height: 5px; background: rgba(255, 255, 255, .25); overflow: hidden; animation: fadeIn .2s ease; border-top-left-radius: 14px; border-top-right-radius: 14px; }
.login-progress .indeterminate { width: 30%; height: 100%; background: var(--accent); animation: indet 1.1s infinite ease-out; }
.btn-spinner { display: inline-block; vertical-align: middle; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .6); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; margin-right: 8px; }
.login-form { width: 100%; background: transparent; color: #0f172a; border-radius: 10px; padding: 0; border: none; }
.login-form .input { display: block; width: 100%; height: 50px; padding: 12px 14px 12px 42px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: #0f2a1d; font-size: 15px; line-height: 1.2; box-shadow: 0 2px 5px rgba(15,23,42,.05); transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.login-form .input::placeholder { color: #64748b; opacity: 1; }
.login-form .input:hover { border-color: #94a3b8; }
.login-form .input:focus { outline: none; border-color: #17804b; background: #fff; box-shadow: 0 0 0 3px rgba(23,128,75,.16), 0 3px 8px rgba(15,23,42,.08); }
.login-form .field { position: relative; display: block; margin-bottom: 14px; }
.login-form .icon-left { position: absolute; left: 14px; top: 25px; transform: translateY(-50%); width: 18px; height: 18px; color: #64748b; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.login-form .field:focus-within .icon-left { color: #17804b; }
.login-form .btn { width: 100%; padding: 12px 14px; font-size: 16px; border-radius: 10px; margin-top: 4px; }
.login-help-link { margin-top: 14px; text-align: center; font-size: 13px; }
.login-help-link a, .auth-back-link { color: #166534; font-weight: 600; text-decoration: none; }
.login-help-link a:hover, .auth-back-link:hover { color: #14532d; text-decoration: underline; }
.auth-secondary-page { position: relative; display: flex; min-height: 100dvh; align-items: center; justify-content: center; padding: 32px 20px; background: #0b1220 url("../images/lotes-bg.jpg") center / cover no-repeat; }
.auth-secondary-card { width: min(460px, 100%); padding: 28px; text-align: left; }
.auth-secondary-card .login-title { margin-bottom: 10px; }
.auth-description { margin: 0 0 22px; color: #64748b; font-size: .9rem; line-height: 1.5; text-align: center; }
.auth-form .auth-field { margin-bottom: 16px; }
.auth-form .auth-field label { display: block; margin-bottom: 6px; color: #334155; font-size: .82rem; font-weight: 700; }
.auth-form .form-control { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a; }
.auth-form .form-control:focus { border-color: #17804b; box-shadow: 0 0 0 3px rgba(23,128,75,.14); outline: 0; }
.auth-form .btn { width: 100%; margin-top: 4px; }
.auth-back-link { display: block; margin-top: 18px; text-align: center; font-size: .85rem; }
.auth-success-icon { display: flex; width: 56px; height: 56px; align-items: center; justify-content: center; margin: 4px auto 16px; border-radius: 50%; background: #dcfce7; color: #15803d; font-size: 1.5rem; }
html.app-skin-dark .auth-secondary-card { background: #121a2d; border-color: #334155; color: #e5e7eb; }
html.app-skin-dark .auth-description { color: #94a3b8; }
html.app-skin-dark .auth-form .auth-field label { color: #cbd5e1; }
html.app-skin-dark .auth-form .form-control { border-color: #475569; background: #1b2436; color: #e5e7eb; }
html.app-skin-dark .auth-success-icon { background: #14532d; color: #86efac; }
.btn { padding: 8px 12px; border: 1px solid var(--muted); background: var(--panel); color: var(--text); border-radius: 8px; cursor: pointer; transition: filter .15s ease, background-color .15s ease, box-shadow .15s ease; }
.btn.primary { border-color: #166534; background: #166534; color: #fff; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { cursor: wait; opacity: .85; }
.login-error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-size: 14px; text-align: center; }
[hidden] { display: none !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes indet { 0% { transform: translateX(-120%); } 100% { transform: translateX(400%); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (max-width: 960px) {
    .login-center { padding: 16px; }
    .login-card, .license-box, .login-footer { width: 92%; }
}

@media (max-height: 820px) and (orientation: landscape) {
    .login-center { justify-content: center; padding-top: 20px; padding-bottom: 20px; }
    .login-footer { position: static; left: auto; bottom: auto; transform: none; margin-top: 10px; }
}

@media (max-height: 700px) {
    .login-center { justify-content: center; padding-top: 16px; padding-bottom: 16px; }
    .login-card, .license-box { width: min(95%, 520px); }
    .login-footer { position: static; left: auto; bottom: auto; transform: none; margin-top: 10px; width: min(95%, 520px); }
}
