/* ================================================================
   AUTH — Star Solution | Login / Register / Forgot Password
   ================================================================ */

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body.auth-body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #1a1035 65%, #05071a 100%);
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ---------- Root wrapper ---------- */
.auth-root {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: auth-fadein 0.45s ease both;
}

@keyframes auth-fadein {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Card ---------- */
.auth-card {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    max-width: 940px;
    width: 100%;
    background: #ffffff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow:
        0 32px 80px rgba(10, 10, 40, 0.55),
        0 0 0 1px rgba(148, 163, 184, 0.12);
}

/* ================================================================
   LEFT PANEL — form
   ================================================================ */
.auth-left {
    padding: 44px 36px 36px;
    display: flex;
    flex-direction: column;
}

.auth-left-inner {
    max-width: 380px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Logo no topo do formulário */
.auth-logo-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.auth-logo-top img,
.auth-logo-img {
    height: 52px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.auth-logo-fallback {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--auth-primary, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-right: 10px;
}

.auth-logo-fallback svg {
    width: 28px;
    height: 28px;
    stroke: #fff;
}

.auth-logo-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--auth-text, #0f172a);
    line-height: 1;
}

/* ---------- Header ---------- */
.auth-header {
    margin-bottom: 24px;
}

.auth-title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 14px;
    color: #64748b;
    font-weight: 400;
}

/* ---------- Alerts ---------- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 18px;
}

.auth-alert svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 1px;
    fill: currentColor;
}

.auth-alert--error {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.auth-alert--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.auth-alert--debug {
    background: #0f172a;
    color: #facc15;
    border: 1px solid #713f12;
    font-size: 12px;
    font-family: monospace;
    word-break: break-all;
    border-radius: 10px;
    margin-bottom: 18px;
}

/* ---------- Form ---------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Field */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-field label {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: 0.01em;
}

.auth-forgot-link {
    font-size: 12px;
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.auth-forgot-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Input wrapper */
.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    padding: 0 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.auth-input-wrapper:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: #ffffff;
}

.auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    flex-shrink: 0;
}

.auth-icon svg {
    width: 17px;
    height: 17px;
}

.auth-input-wrapper input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    padding: 13px 10px;
    font-size: 14.5px;
    font-family: inherit;
    color: #0f172a;
    font-weight: 500;
    min-width: 0;
}

.auth-input-wrapper input::placeholder {
    color: #b0bec5;
    font-weight: 400;
}

/* Toggle password button */
.auth-toggle-password {
    border: none;
    background: none;
    padding: 4px;
    margin-left: 4px;
    cursor: pointer;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.14s ease, background 0.14s ease;
    flex-shrink: 0;
}

.auth-toggle-password:hover {
    color: #4f46e5;
    background: #eef2ff;
}

.auth-toggle-password svg {
    width: 17px;
    height: 17px;
}

/* ---------- Submit button ---------- */
.auth-actions {
    margin-top: 4px;
}

.auth-btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.01em;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #7c3aed 100%);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45), 0 2px 6px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: transform 0.13s ease, box-shadow 0.13s ease, filter 0.13s ease;
    position: relative;
    overflow: hidden;
}

.auth-btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(99, 102, 241, 0.55), 0 4px 10px rgba(99, 102, 241, 0.35);
}

.auth-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.auth-btn-arrow {
    width: 17px;
    height: 17px;
    transition: transform 0.2s ease;
}

.auth-btn-primary:hover .auth-btn-arrow {
    transform: translateX(3px);
}

/* ---------- Divider ---------- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 2px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ---------- Links ---------- */
.auth-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
    transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease, transform 0.1s ease;
}

.auth-link-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.auth-link-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4f46e5;
    transform: translateY(-1px);
}

/* ---------- Disclaimer ---------- */
.auth-disclaimer {
    margin-top: 22px;
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.6;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 18px;
}

/* ================================================================
   RIGHT PANEL — branding
   ================================================================ */
.auth-right {
    position: relative;
    background: linear-gradient(145deg, #4f46e5 0%, #6d28d9 40%, #0f172a 100%);
    color: #e2e8f0;
    overflow: hidden;
}

/* Glows */
.auth-right::before,
.auth-right::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(50px);
    pointer-events: none;
}

.auth-right::before {
    width: 280px;
    height: 280px;
    background: rgba(34, 211, 238, 0.28);
    top: -100px;
    right: -100px;
    animation: glow-drift 8s ease-in-out infinite alternate;
}

.auth-right::after {
    width: 300px;
    height: 300px;
    background: rgba(249, 115, 22, 0.22);
    bottom: -100px;
    left: -80px;
    animation: glow-drift 10s ease-in-out infinite alternate-reverse;
}

@keyframes glow-drift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(20px, 20px) scale(1.06); }
}

/* Inner layout */
.auth-right-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 32px 36px;
}

/* Logo topo do painel direito */
.auth-right-logo-top {
    display: flex;
    justify-content: center;
}

.auth-right-logo-top img {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

/* Highlight card */
.auth-highlight-card {
    flex: 1;
    margin: 32px 0;
    padding: 22px 20px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.auth-highlight-card h2 {
    font-size: 17px;
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.auth-highlight-card p {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
    line-height: 1.55;
}

.auth-highlight-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-highlight-card li {
    font-size: 13px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.auth-highlight-card li::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #34d399, #38bdf8);
    flex-shrink: 0;
}

.auth-card-logo {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-card-logo img {
    width: 100%;
    max-width: 180px;
    height: auto;
    object-fit: contain;
}

/* Logo at the bottom */
.auth-right-logo {
    display: flex;
    justify-content: center;
}

.auth-right-logo img {
    height: 42px;
    width: auto;
    opacity: 0.75;
    filter: brightness(0) invert(1);
    transition: opacity 0.2s ease;
}

.auth-right-logo img:hover {
    opacity: 1;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 920px) {
    .auth-card {
        max-width: 480px;
        grid-template-columns: 1fr;
    }

    .auth-right {
        display: none;
    }

    /* .auth-logo-top já visível em todos os tamanhos */
}

@media (max-width: 600px) {
    .auth-root {
        padding: 12px;
        align-items: flex-start;
        padding-top: 24px;
    }

    .auth-card {
        border-radius: 20px;
    }

    .auth-left {
        padding: 32px 24px 28px;
    }

    .auth-title {
        font-size: 22px;
    }
}
