/* ==========================================================================
   Crown Solar Energy - True Full-Screen Authentication (Login & Register)
   - 100% Full-screen viewport (100vw, 100vh)
   - 3D hardware background (Solar panels + Crown inverters)
   - ONE unified symmetrical linear-gradient across the entire screen
   - Clean White Card on the right with crisp elevation
   - Primary accent: #4154f1 (hover #3446d6, active #2c3bbd)
   - Crisp 2px outline on focus (no fuzzy glow)
   - Inline Lucide icons (stroke 1.75, 18px)
   - Spacing: 4px label-to-input, 14px field-to-field, 24px+ sections
   - Nested corners: Card 20px radius, inputs and buttons 8px radius
   - Smooth 180ms ease-out transitions
   ========================================================================== */

:root {
    --accent: #4154f1;
    --accent-hover: #3446d6;
    --accent-active: #2c3bbd;
    --accent-tint: #93c5fd;
    --bg: #081230;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #dc2626;
    --radius-card: 20px;
    --radius-inner: 8px;
    --ease: 180ms ease-out;
}

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

html,
body {
    width: 100%;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--bg);
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

main[role="main"] {
    padding: 0 !important;
    margin: 0 !important;
}

footer,
.footer,
.border-top {
    display: none !important;
}

/* Lucide Icon Base */
.icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ================= 100% TRUE FULL-SCREEN CONTAINER ================= */
.sa-page {
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #081230 url('/assets/img/crown-auth-bg.webp') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    position: relative;
}

/* ONE SINGLE UNIFIED GRADIENT OVERLAY ACROSS THE ENTIRE SCREEN */
.sa-content {
    flex: 1;
    display: flex;
    width: 100%;
    min-height: calc(100vh - 48px);
    position: relative;
    z-index: 2;
    background: linear-gradient(90deg,
            rgba(7, 16, 46, 0.94) 0%,
            rgba(7, 16, 46, 0.82) 28%,
            rgba(7, 16, 46, 0.18) 46%,
            rgba(7, 16, 46, 0.18) 54%,
            rgba(7, 16, 46, 0.82) 72%,
            rgba(7, 16, 46, 0.94) 100%);
    border-radius: 0;
    box-shadow: none;
}

/* ================= Left Brand Surface (Transparent, shares unified gradient) ================= */
.sa-brand {
    flex: 1 1 54%;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 64px;
    color: #ffffff;
    background: transparent;
}

.sa-brand-top {
    display: flex;
    align-items: center;
}

.sa-logo {
    height: 80px;
    width: auto;
    align-self: flex-start;
}

.sa-brand-body {
    margin: 36px 0;
    max-width: 500px;
}

.sa-title {
    font-size: clamp(2.2rem, 3.5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin: 0 0 16px;
    color: #ffffff;
}

.sa-title span {
    color: var(--accent-tint);
}

.sa-sub {
    color: #cbd5e1;
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 440px;
    margin: 0 0 28px;
}

/* Feature list in single surface with dividers */
.sa-features {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 440px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.sa-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.sa-features li .icon {
    color: var(--accent-tint);
}

.sa-brand-bottom {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.4px;
}

/* ================= Right Form Wrapper (Transparent, shares unified gradient) ================= */
.sa-form-wrap {
    flex: 1 1 46%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 48px;
    position: relative;
    z-index: 2;
    background: transparent;
}

/* The White Card: Clean elevation with crisp shadow */
.sa-card {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 42px 44px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.40);
    position: relative;
}

.sa-mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 24px;
}

.sa-mobile-logo img {
    height: 48px;
    width: auto;
}

.sa-card h1 {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--text);
    letter-spacing: -0.3px;
}

.sa-card .muted {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0 0 26px;
    line-height: 1.5;
}

/* Form Spacing: 14px between fields */
.sa-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sa-field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Form Spacing: 4px between label and input */
.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    margin: 0;
}

/* Field with leading icon */
.sa-field {
    position: relative;
    display: flex;
}

.sa-field>.icon.lead {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    z-index: 4;
    pointer-events: none;
    transition: color var(--ease);
}

.sa-field:focus-within>.icon.lead {
    color: var(--accent);
}

/* Inputs: Nested 8px radius, flat fill, 2px outline on focus (no glow) */
.form-control {
    width: 100%;
    background: var(--surface);
    border: 1px solid #cbd5e1;
    color: var(--text);
    border-radius: var(--radius-inner);
    padding: 13px 14px 13px 44px;
    font-size: 0.95rem;
    height: auto;
    box-shadow: none;
    transition: border-color var(--ease);
    font-family: inherit;
    line-height: 1.4;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:focus {
    border-color: var(--accent);
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    box-shadow: none;
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text) !important;
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
}

/* Password field with attached eye toggle button */
.sa-field.input-group .form-control {
    border-radius: var(--radius-inner) 0 0 var(--radius-inner);
}

.btn-eye {
    background: var(--surface);
    border: 1px solid #cbd5e1;
    border-left: 0;
    border-radius: 0 var(--radius-inner) var(--radius-inner) 0;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    cursor: pointer;
    transition: color var(--ease), border-color var(--ease);
    outline: none;
}

.btn-eye:hover {
    color: var(--accent);
}

.btn-eye:focus,
.btn-eye:active {
    box-shadow: none;
    outline: none;
}

.sa-field:focus-within .form-control,
.sa-field:focus-within .btn-eye {
    border-color: var(--accent);
}

/* Checkbox */
.sa-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.sa-check input[type="checkbox"],
.sa-check .form-check-input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent);
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.sa-check label {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

/* Action button: Nested 8px radius, accent fill, 180ms ease-out transition */
.sa-btn {
    width: 100%;
    border: 0;
    border-radius: var(--radius-inner);
    padding: 14px 18px;
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #ffffff;
    background: var(--accent);
    cursor: pointer;
    transition: background-color var(--ease), transform var(--ease);
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(65, 84, 241, 0.3);
}

.sa-btn .icon {
    transition: transform var(--ease);
}

.sa-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 18px rgba(65, 84, 241, 0.4);
    color: #ffffff;
}

.sa-btn:hover .icon {
    transform: translateX(3px);
}

.sa-btn:active {
    background: var(--accent-active);
}

.sa-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Switch link */
.sa-switch {
    color: var(--text-muted);
    font-size: 0.92rem;
    text-align: center;
    margin: 16px 0 0;
}

.sa-card a.link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--ease);
}

.sa-card a.link:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

/* Validation error text */
.sa-error {
    display: block;
    margin-top: 4px;
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 600;
}

.sa-error:empty {
    display: none;
}

/* ================= Integrated Full-Screen Footer ================= */
.sa-footer {
    width: 100%;
    padding: 14px 24px;
    text-align: center;
    background: rgba(7, 16, 46, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    z-index: 3;
    margin-top: auto;
}

.sa-footer-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.sa-footer-text,
.sa-footer-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sa-footer .icon {
    width: 14px;
    height: 14px;
    color: #60a5fa;
}

.sa-dev {
    color: #f1f5f9;
    font-weight: 700;
    text-decoration: none;
    transition: color var(--ease);
}

a.sa-dev:hover,
.sa-footer-phone:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.sa-footer-phone {
    color: #f1f5f9;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--ease);
}

.sa-divider {
    color: rgba(255, 255, 255, 0.25);
}

/* ================= Responsive Breakpoints ================= */
@media (max-width: 991px) {
    .sa-content {
        flex-direction: column;
        background: linear-gradient(180deg, rgba(7, 16, 46, 0.94) 0%, rgba(7, 16, 46, 0.88) 100%);
    }

    .sa-brand {
        display: none;
    }

    .sa-mobile-logo {
        display: block;
    }

    .sa-form-wrap {
        flex-basis: 100%;
        padding: 40px 20px;
    }

    .sa-card {
        max-width: 460px;
        padding: 36px 28px;
    }
}

@media (max-width: 480px) {
    .sa-card {
        padding: 28px 20px;
    }
}