/* =====================================================================
   UnderHost @CustomerPanel — WHMCS Login Stylesheet (v2)
   Premium SaaS redesign aligned to the UnderHost brand system
   (DESIGN.MD): dark navy base, cyan/cobalt energy, controlled glow.

   - Pure-CSS animated background (no hero image; CWV-friendly)
   - Split premium card: immersive brand panel + clean form panel
   - Accessible focus states, visible labels, reduced-motion support
   ===================================================================== */

:root {
    --uh-primary:        #00D4FF;
    --uh-primary-dark:   #0091D6;
    --uh-secondary-dark: #0078B8;

    --uh-dark-base:      #0A1220;
    --uh-dark-mid:       #0D1B30;
    --uh-dark-panel:     #0F2040;
    --uh-dark-deep:      #071428;

    --uh-surface:        #FFFFFF;
    --uh-surface-soft:   #F7F9FC;
    --uh-border:         #E5E9F0;
    --uh-ink:            #0A1220;
    --uh-ink-soft:       #5A6B82;
    --uh-ink-faint:      #8A99AE;

    --uh-success:        #34D399;
    --uh-error:          #EF4444;

    --uh-gradient-horizontal: linear-gradient(90deg, #00D4FF, #0091D6);
    --uh-gradient-btn:        linear-gradient(95deg, #0091D6 0%, #00B4E6 55%, #00D4FF 100%);
    --uh-gradient-btn-hover:  linear-gradient(95deg, #0078B8 0%, #0091D6 55%, #00B4E6 100%);

    --uh-shadow-card:  0 40px 90px -30px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255,255,255,0.05);
    --uh-shadow-btn:   0 10px 26px -8px rgba(0, 145, 214, 0.65);
    --uh-shadow-btn-h: 0 16px 34px -8px rgba(0, 180, 230, 0.78);

    --uh-radius:    22px;
    --uh-radius-sm: 12px;

    --uh-font:  'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
    --uh-head:  'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --uh-mono:  'JetBrains Mono', 'IBM Plex Mono', SFMono-Regular, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body.login-page,
body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--uh-font);
    color: var(--uh-ink);
    background: var(--uh-dark-base);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    position: relative;
    overflow-x: hidden;
}

/* ===== Animated pure-CSS background ===== */
.login-page {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Datacenter photo as the full-page background (behind the card) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background: #0A1220 url('https://cdn.underhost.com/images/login.jpg') center / cover no-repeat;
}

/* Navy + cyan scrim so the photo reads as a backdrop and the card pops */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(90% 70% at 50% 0%, rgba(0, 212, 255, 0.14), transparent 55%),
        linear-gradient(150deg, rgba(10, 18, 32, 0.58) 0%, rgba(9, 15, 30, 0.48) 45%, rgba(6, 12, 26, 0.72) 100%);
}

@keyframes uh-bg-drift {
    0%   { background-position: 0% 50%, 0% 50%, 0% 50%; }
    50%  { background-position: 0% 50%, 0% 50%, 100% 50%; }
    100% { background-position: 0% 50%, 0% 50%, 0% 50%; }
}

/* Floating cyan glow blobs (GPU transform/opacity only) */
.uh-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
    will-change: transform;
}
.uh-glow.g1 {
    width: 460px; height: 460px;
    top: -160px; left: -120px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.55), transparent 70%);
    animation: uh-float-a 18s ease-in-out infinite;
}
.uh-glow.g2 {
    width: 520px; height: 520px;
    bottom: -200px; right: -160px;
    background: radial-gradient(circle, rgba(0, 120, 184, 0.55), transparent 70%);
    animation: uh-float-b 22s ease-in-out infinite;
}
.uh-glow.g3 {
    width: 300px; height: 300px;
    top: 55%; left: 8%;
    background: radial-gradient(circle, rgba(0, 145, 214, 0.40), transparent 70%);
    animation: uh-float-a 26s ease-in-out infinite reverse;
}

@keyframes uh-float-a {
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50%     { transform: translate3d(40px, 50px, 0) scale(1.08); }
}
@keyframes uh-float-b {
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50%     { transform: translate3d(-50px, -40px, 0) scale(1.1); }
}

/* ===== Card ===== */
.login-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    width: 100%;
    max-width: 960px;
    min-height: 560px;
    background: var(--uh-surface);
    border-radius: var(--uh-radius);
    box-shadow: var(--uh-shadow-card);
    overflow: hidden;
    isolation: isolate;
}

/* =====================================================================
   BRAND / WELCOME PANEL (left, immersive dark)
   ===================================================================== */
.login-info-container {
    position: relative;
    color: #fff;
    padding: 52px 48px;
    display: grid;
    grid-template-rows: auto auto;
    align-content: center;
    justify-items: center;
    row-gap: 92px;
    text-align: center;
    background:
        radial-gradient(110% 70% at 20% 8%, rgba(0, 212, 255, 0.20), transparent 55%),
        radial-gradient(90% 80% at 95% 100%, rgba(0, 120, 184, 0.28), transparent 60%),
        linear-gradient(160deg, #0C1830 0%, #0A1424 45%, #081020 100%);
    overflow: hidden;
}

/* Soft cyan glow accent */
.login-info-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(80% 55% at 88% 100%, rgba(0, 145, 214, 0.22), transparent 60%);
    z-index: 0;
    pointer-events: none;
}

/* Soft bottom vignette so the welcome copy always reads cleanly */
.login-info-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(6, 12, 26, 0.45) 100%);
    z-index: 0;
    pointer-events: none;
}

.login-info-container > * {
    position: relative;
    z-index: 1;
}

/* Status pill (top) - kept for compatibility if re-added in the template */
.uh-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    align-self: flex-start;
    padding: 7px 14px 7px 11px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #CFE9F5;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.22);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}
.uh-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--uh-success);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    animation: uh-pulse 2.4s ease-out infinite;
}
@keyframes uh-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Brand logo */
.branding {
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.branding img {
    width: auto;
    height: 103px;
    max-width: 360px;
    object-fit: contain;
    filter: drop-shadow(0 6px 22px rgba(0, 212, 255, 0.35));
    display: block;
    margin: 0 auto;
}

/* Welcome copy */
.uh-welcome {
    width: 100%;
    max-width: 420px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.login-info-container h2,
#random-heading {
    font-family: var(--uh-head);
    font-size: 34px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 14px;
    color: #fff;
    text-wrap: balance;
    text-align: center;
}
.login-info-container h2 .uh-accent,
.uh-accent { color: var(--uh-primary); }

#random-phrase,
.login-info-container p {
    font-size: 16px;
    line-height: 1.6;
    color: #AEC2DB;
    margin: 0 auto;
    max-width: 34ch;
    text-align: center;
}

/* Trust row */
.uh-trust-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}
.uh-trust-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #D5E4F2;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}
.uh-trust-chip i { color: var(--uh-primary); font-size: 13px; }

/* =====================================================================
   FORM PANEL (right, clean light)
   ===================================================================== */
.login-form-container {
    position: relative;
    background: var(--uh-surface);
    padding: 52px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-heading {
    font-family: var(--uh-head);
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--uh-ink);
    margin: 0;
    text-transform: none;
}
.login-subtext {
    font-size: 14.5px;
    color: var(--uh-ink-soft);
    margin: 7px 0 26px;
    line-height: 1.5;
}

/* Flash / alert messages */
.uh-alert,
.errorbox, .successbox, .infobox {
    border-radius: var(--uh-radius-sm);
    padding: 13px 16px;
    margin: 0 0 18px;
    font-size: 13.5px;
    line-height: 1.5;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid transparent;
}
.uh-alert i { margin-top: 2px; }
.errorbox, .uh-alert--error {
    background: #FEF2F2; border-color: #FECACA; color: #B42318;
}
.successbox, .uh-alert--success {
    background: #ECFDF5; border-color: #A7F3D0; color: #047857;
}
.infobox, .uh-alert--info {
    background: #EFF8FF; border-color: #B9E2FF; color: #0078B8;
}

/* Form fields */
.login-form { display: flex; flex-direction: column; gap: 18px; }

.uh-field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--uh-ink);
    margin-bottom: 7px;
    letter-spacing: 0.01em;
}

.input-group {
    position: relative;
    width: 100%;
    margin: 0;
}
.input-group > i:first-of-type {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--uh-ink-faint);
    font-size: 15px;
    transition: color 0.18s ease;
    pointer-events: none;
}
.input-group .form-control,
.input-group input {
    width: 100%;
    height: 52px;
    padding: 0 46px 0 42px;
    font-family: var(--uh-font);
    font-size: 15px;
    color: var(--uh-ink);
    background: var(--uh-surface-soft);
    border: 1.5px solid var(--uh-border);
    border-radius: var(--uh-radius-sm);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.input-group input::placeholder { color: var(--uh-ink-faint); }
.input-group input:hover { border-color: #CBD5E1; }
.input-group input:focus {
    background: #fff;
    border-color: var(--uh-primary);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.15);
}
.input-group:focus-within > i:first-of-type { color: var(--uh-primary-dark); }

.toggle-password-container {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--uh-ink-faint);
    transition: color 0.18s ease, background 0.18s ease;
}
.toggle-password-container:hover { color: var(--uh-primary-dark); background: rgba(0,145,214,0.08); }
.toggle-password-container i { font-size: 16px; }

/* Captcha */
.captcha-container {
    display: flex;
    justify-content: center;
    margin: 2px 0;
}

/* Remember / forgot row */
.extra-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    margin: 2px 0;
}
.extra-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--uh-ink-soft);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}
.extra-options input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--uh-primary-dark);
    cursor: pointer;
}
.extra-options a {
    color: var(--uh-primary-dark);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.18s ease;
}
.extra-options a:hover { color: var(--uh-secondary-dark); text-decoration: underline; }

/* Login button */
.login-btn {
    position: relative;
    width: 100%;
    height: 54px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--uh-head);
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fff;
    background: var(--uh-gradient-btn);
    border: none;
    border-radius: var(--uh-radius-sm);
    cursor: pointer;
    box-shadow: var(--uh-shadow-btn);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    overflow: hidden;
    white-space: nowrap;
}
.login-btn::after {
    content: "";
    position: absolute;
    top: 0; left: -120%;
    width: 60%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-18deg);
    transition: none;
}
.login-btn:hover {
    background: var(--uh-gradient-btn-hover);
    transform: translateY(-2px);
    box-shadow: var(--uh-shadow-btn-h);
}
.login-btn:hover::after { animation: uh-sheen 0.9s ease; }
@keyframes uh-sheen { from { left: -120%; } to { left: 130%; } }
.login-btn:active { transform: translateY(0); }
.login-btn:focus-visible {
    outline: 3px solid rgba(0, 212, 255, 0.45);
    outline-offset: 3px;
}

.loading-spinner { display: none; align-items: center; }
.login-btn.loading { opacity: 0.92; cursor: progress; pointer-events: none; }
.login-btn.loading .loading-spinner { display: inline-flex; }

/* Divider before linked accounts */
.uh-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0 4px;
    color: var(--uh-ink-faint);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.uh-divider::before, .uh-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--uh-border);
}

/* Linked / social accounts container (WHMCS output) */
.uh-linked { margin-top: 8px; }
.uh-linked .btn,
.uh-linked a.btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    margin: 8px 0 0;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--uh-ink) !important;
    background: #fff;
    border: 1.5px solid var(--uh-border);
    border-radius: var(--uh-radius-sm);
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.uh-linked .btn:hover {
    border-color: var(--uh-primary);
    box-shadow: 0 6px 18px -8px rgba(0,145,214,0.4);
    transform: translateY(-1px);
}
.hidden { display: none !important; }

/* Register + secondary links */
.register-link {
    margin: 16px 0 0;
    font-size: 14px;
    text-align: center;
    color: var(--uh-ink-soft);
    font-weight: 500;
}
.register-link a {
    color: var(--uh-primary-dark);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.18s ease;
}
.register-link a:hover { color: var(--uh-secondary-dark); text-decoration: underline; }

.uh-secondary-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}
.uh-help-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--uh-ink-soft);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--uh-border);
    transition: all 0.18s ease;
}
.uh-help-link i { color: var(--uh-primary-dark); }
.uh-help-link:hover {
    color: var(--uh-ink);
    border-color: var(--uh-primary);
    background: var(--uh-surface-soft);
}

/* Language selector */
.uh-lang {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--uh-ink-soft);
}
.uh-lang i { color: var(--uh-ink-faint); }
.uh-lang select {
    font-family: var(--uh-font);
    font-size: 13px;
    color: var(--uh-ink);
    padding: 7px 10px;
    border: 1.5px solid var(--uh-border);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.uh-lang select:focus {
    outline: none;
    border-color: var(--uh-primary);
    box-shadow: 0 0 0 3px rgba(0,212,255,0.15);
}

/* Footer of form panel */
.uh-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--uh-border);
    flex-wrap: wrap;
}
.copyright {
    margin: 0;
    font-size: 11.5px;
    color: var(--uh-ink-faint);
    text-align: left;
    line-height: 1.5;
}

/* =====================================================================
   RESPONSIVE — compact mobile login, no trust chips on mobile
   ===================================================================== */

@media (max-width: 860px) {
    body.login-page,
    body {
        padding: 14px;
        align-items: center;
        justify-content: center;
        min-height: 100svh;
    }

    .login-page {
        min-height: 100svh;
        align-items: center;
    }

    .login-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        max-width: 430px;
        min-height: 0;
        border-radius: 22px;
        overflow: hidden;
    }

    .login-info-container {
        order: -1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        row-gap: 0;
        padding: 20px 26px 14px;
        min-height: auto;
        text-align: left;
    }

    .login-info-container::after {
        opacity: 0.22;
    }

    .branding {
        width: auto;
        margin: 0 0 10px;
        justify-content: flex-start;
    }

    .branding img {
        height: 52px;
        max-width: 230px;
        margin: 0;
    }

    .uh-welcome {
        width: 100%;
        max-width: none;
        margin: 0;
        display: block;
        text-align: left;
    }

    #random-heading,
    .login-info-container h2 {
        font-size: 23px;
        line-height: 1.12;
        margin: 0 0 4px;
        text-align: left;
    }

    #random-phrase,
    .login-info-container p {
        font-size: 13.5px;
        line-height: 1.35;
        max-width: none;
        margin: 0;
        text-align: left;
    }

    /* Hide the three trust chips on mobile to keep the form above the fold */
    .uh-trust-row {
        display: none !important;
    }

    .login-form-container {
        padding: 22px 26px 20px;
        justify-content: flex-start !important;
    }

    .login-heading {
        font-size: 25px;
    }

    .login-subtext {
        margin: 5px 0 18px;
        font-size: 14px;
    }

    .login-form {
        gap: 14px;
    }

    .uh-field-label {
        margin-bottom: 6px;
    }

    .input-group .form-control,
    .input-group input {
        height: 50px;
        font-size: 16px;
    }

    .login-btn {
        height: 52px;
        margin-top: 2px;
    }

    .register-link {
        margin-top: 12px;
    }

    .uh-secondary-links {
        margin-top: 10px;
    }

    .uh-help-link {
        padding: 7px 13px;
        font-size: 13px;
    }

    .uh-form-foot {
        margin-top: 16px;
        padding-top: 14px;
        justify-content: center;
        text-align: center;
    }

    .copyright {
        text-align: center;
        font-size: 11px;
    }
}

@media (max-width: 460px) {
    body.login-page,
    body {
        padding: 0;
        align-items: stretch;
        min-height: 100svh;
        overflow-x: hidden;
    }

    .login-page {
        min-height: 100svh;
        align-items: stretch;
    }

    .login-container {
        max-width: none;
        width: 100%;
        min-height: 100svh;
        border-radius: 0;
        box-shadow: none;
        display: grid;
        grid-template-rows: auto 1fr;
    }

    .login-info-container {
        padding: 16px 22px 13px;
    }

    .branding {
        margin: 0 0 8px;
    }

    .branding img {
        height: 48px;
        max-width: 220px;
    }

    #random-heading,
    .login-info-container h2 {
        font-size: 21px;
        margin-bottom: 4px;
    }

    #random-phrase,
    .login-info-container p {
        font-size: 12.5px;
        line-height: 1.35;
    }

    .login-form-container {
        min-height: 0;
        padding: 18px 22px calc(16px + env(safe-area-inset-bottom));
        justify-content: flex-start !important;
    }

    .login-heading {
        font-size: 24px;
    }

    .login-subtext {
        margin: 4px 0 16px;
        font-size: 13.5px;
    }

    .login-form {
        gap: 13px;
    }

    .uh-field-label {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .input-group .form-control,
    .input-group input {
        height: 48px;
        border-radius: 12px;
    }

    .toggle-password-container {
        width: 34px;
        height: 34px;
    }

    .extra-options {
        font-size: 12.5px;
        gap: 10px;
    }

    .extra-options input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    .login-btn {
        height: 50px;
        border-radius: 12px;
    }

    .register-link {
        margin-top: 10px;
        font-size: 13.5px;
    }

    .uh-secondary-links {
        margin-top: 9px;
    }

    .uh-help-link {
        padding: 6px 12px;
        font-size: 12.5px;
    }

    .uh-form-foot {
        margin-top: 14px;
        padding-top: 12px;
        gap: 10px;
    }

    .uh-lang {
        font-size: 12px;
    }

    .uh-lang select {
        font-size: 12px;
        padding: 6px 9px;
    }
}

@media (max-width: 380px), (max-height: 760px) and (max-width: 460px) {
    .login-info-container {
        padding: 14px 20px 10px;
    }

    .branding img {
        height: 44px;
        max-width: 205px;
    }

    #random-heading,
    .login-info-container h2 {
        font-size: 20px;
    }

    #random-phrase,
    .login-info-container p {
        display: none;
    }

    .login-form-container {
        padding-top: 15px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .login-subtext {
        margin-bottom: 13px;
    }

    .login-form {
        gap: 11px;
    }

    .uh-form-foot {
        margin-top: 10px;
        padding-top: 10px;
    }
}

@media (max-width: 360px) {
    .extra-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .extra-options a {
        align-self: flex-end;
    }
}

/* Very short phones / landscape: keep only the logo so the form remains usable */
@media (max-height: 640px) and (max-width: 860px) {
    body.login-page,
    body {
        overflow-y: auto;
    }

    .login-info-container {
        padding: 12px 20px 10px;
    }

    .uh-welcome {

        display: none;
    }

    .branding {
        margin: 0;
    }

    .branding img {
        height: 40px;
    }

    .login-form-container {
        padding-top: 14px;
        justify-content: flex-start !important;
    }
}

/* =====================================================================
   ACCESSIBILITY — reduced motion
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    body::before {
        background: #0A1220 url('https://cdn.underhost.com/images/login.jpg') center / cover no-repeat;
    }
    .uh-glow { opacity: 0.4; }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(0, 212, 255, 0.5);
    outline-offset: 2px;
}

/* Visually-hidden helper (accessible labels) */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* =====================================================================
   FINAL OVERRIDES — visible desktop/mobile alignment fix
   ===================================================================== */

/* Desktop/tablet: make the left panel content read as one centered group */
@media (min-width: 861px) {
    .login-info-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 52px 48px !important;
    }

    .branding {
        width: 100% !important;
        margin: 0 0 82px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .branding img {
        height: 103px !important;
        max-width: 360px !important;
        margin: 0 auto !important;
    }

    .uh-welcome {
        width: 100% !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    #random-heading,
    .login-info-container h2 {
        text-align: center !important;
        margin: 0 0 14px !important;
    }

    #random-phrase,
    .login-info-container p {
        text-align: center !important;
        margin: 0 auto !important;
        max-width: 34ch !important;
    }

    .uh-trust-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        margin-top: 30px !important;
    }

    .uh-trust-chip {
        white-space: nowrap !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
}

/* Mobile: bigger logo, less empty space, form starts directly after header */
@media (max-width: 860px) {
    body.login-page,
    body {
        padding: 0 !important;
        align-items: stretch !important;
        min-height: 100svh !important;
    }

    .login-page {
        min-height: 100svh !important;
        align-items: stretch !important;
    }

    .login-container {
        width: 100% !important;
        max-width: none !important;
        min-height: 100svh !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto 1fr !important;
    }

    .login-info-container {
        padding: 18px 22px 14px !important;
        min-height: auto !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        text-align: left !important;
    }

    .branding {
        margin: 0 0 10px !important;
        display: block !important;
        width: auto !important;
    }

    .branding img {
        height: 50px !important;
        max-width: 235px !important;
        margin: 0 !important;
    }

    .uh-welcome {
        margin: 0 !important;
        display: block !important;
        width: 100% !important;
        text-align: left !important;
    }

    #random-heading,
    .login-info-container h2 {
        font-size: 22px !important;
        line-height: 1.12 !important;
        margin: 0 0 4px !important;
        text-align: left !important;
    }

    #random-phrase,
    .login-info-container p {
        font-size: 13px !important;
        line-height: 1.35 !important;
        margin: 0 !important;
        max-width: none !important;
        text-align: left !important;
    }

    .uh-trust-row {
        display: none !important;
    }

    .login-form-container {
        min-height: 0 !important;
        padding: 22px 22px calc(16px + env(safe-area-inset-bottom)) !important;
        justify-content: flex-start !important;
    }
}

@media (max-width: 390px) {
    .login-info-container {
        padding: 16px 20px 12px !important;
    }

    .branding img {
        height: 46px !important;
        max-width: 220px !important;
    }

    #random-heading,
    .login-info-container h2 {
        font-size: 21px !important;
    }

    .login-form-container {
        padding-top: 20px !important;
    }
}

@media (max-height: 760px) and (max-width: 460px) {
    .branding img {
        height: 42px !important;
    }

    .login-info-container {
        padding-top: 14px !important;
        padding-bottom: 10px !important;
    }

    #random-phrase,
    .login-info-container p {
        display: none !important;
    }

    .login-form-container {
        padding-top: 18px !important;
    }
}
/* =====================================================================
   MOBILE HEADER — centered logo and text
   ===================================================================== */

@media (max-width: 860px) {
    .login-info-container {
        padding: 18px 22px 14px;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .branding {
        width: 100%;
        margin: 0 0 10px;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .branding img {
        height: 46px;
        max-width: 230px;
        margin: 0 auto !important;
    }

    .uh-welcome {
        width: 100%;
        text-align: center !important;
        align-items: center !important;
    }

    #random-heading,
    .login-info-container h2 {
        font-size: 22px;
        line-height: 1.12;
        margin: 0 0 4px;
        text-align: center !important;
    }

    #random-phrase,
    .login-info-container p {
        font-size: 13.5px;
        line-height: 1.35;
        margin: 0 auto;
        max-width: 32ch;
        text-align: center !important;
    }

    .uh-trust-row {
        display: none !important;
    }
}

@media (max-width: 390px) {
    .branding img {
        height: 44px;
        max-width: 220px;
    }

    .login-info-container {
        padding: 17px 20px 13px;
    }

    #random-heading,
    .login-info-container h2 {
        font-size: 21px;
    }

    #random-phrase,
    .login-info-container p {
        font-size: 13px;
    }
}