/* MoonlightWeb — Login view (PIN / certificate auth) */

.login-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: var(--space-5) 0;
}

.login-box {
    width: 100%;
    max-width: 360px;
    background:
        linear-gradient(150deg, rgba(0, 229, 255, 0.06), rgba(0, 229, 255, 0) 60%), var(--surface-2);
    border: none;
    border-radius: 0;
    clip-path: var(--notch-lg);
    box-shadow: var(--edge-cyan);
    padding: var(--space-6) var(--space-5);
    text-align: center;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-3);
    clip-path: var(--notch-sm);
    /* Professional Dark blue — first step of the theme retune, deliberately
       hardcoded so the rest of the (still yellow) accent tokens are untouched */
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.45));
}

/* Moonlight logo recolored via CSS mask (source PNG is gray) */
.login-logo-img {
    display: block;
    width: 48px;
    height: 48px;
    background: currentColor;
    -webkit-mask: url('../../assets/logo.png') center / contain no-repeat;
    mask: url('../../assets/logo.png') center / contain no-repeat;
}

.login-title {
    font-size: var(--fs-xl);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--space-5);
    color: var(--text-1);
    text-shadow: 0 0 14px var(--accent-ring);
}

.login-subtitle {
    font-size: var(--fs-sm);
    color: var(--text-2);
    margin-bottom: var(--space-5);
    line-height: 1.5;
}

.login-form {
    text-align: left;
}

.login-field {
    margin-bottom: var(--space-4);
}

.login-pin-input-wrap,
.login-cert-upload-wrap {
    width: 100%;
}

.login-cert-input {
    width: 100%;
    font-size: var(--fs-sm);
    color: var(--text-2);
}
.login-cert-input::file-selector-button {
    margin-right: var(--space-3);
    padding: 8px 14px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    color: var(--text-1);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
}
.login-cert-input::file-selector-button:hover {
    background: var(--surface-4);
}
.login-file-selected {
    font-size: var(--fs-xs);
    margin-top: var(--space-1);
    color: var(--text-3);
}

.login-submit {
    width: 100%;
    margin-top: var(--space-2);
}

.login-error {
    color: var(--c-danger-text);
    font-size: var(--fs-sm);
    min-height: 1.2em;
    margin: var(--space-2) 0 0;
    line-height: 1.45;
}
/* A populated error becomes a legible alert chip (soft danger panel + light red
   text). The empty placeholder stays blank so the login form doesn't shift. */
.login-error:not(:empty) {
    background: var(--c-danger-soft);
    border: 1px solid rgba(255, 42, 109, 0.35);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    min-height: 0;
}
.login-remaining {
    color: var(--c-warning);
    font-size: var(--fs-xs);
    min-height: 1em;
    margin: var(--space-1) 0 0;
}
.login-lockout {
    color: var(--c-warning);
    font-size: var(--fs-sm);
    background: var(--c-warning-soft);
    border: 1px solid rgba(240, 180, 41, 0.3);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin: var(--space-2) 0 0;
    text-align: center;
}

.login-hint {
    font-size: var(--fs-xs);
    color: var(--text-3);
    margin-top: var(--space-4);
    line-height: 1.5;
}

/* Loading state (auth status check) */
.login-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) 0;
    color: var(--text-2);
    font-size: var(--fs-sm);
}
.login-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--surface-4);
    border-top-color: var(--accent-1);
    border-radius: 50%;
    animation: btnSpin 0.8s linear infinite;
}

/* ── First-run setup wizard ──────────────────────────────────────────────── */
.setup-box {
    max-width: 460px;
    text-align: left;
}
.setup-box .login-title,
.setup-box .login-subtitle,
.setup-box .login-logo {
    text-align: center;
}
/* Neon-green logo on the setup screen: the default yellow sits too close to the
   panel's warm tint and reads poorly. Green matches the hosts "Ready" accent. */
.setup-box .login-logo {
    background: var(--c-success-soft);
    color: var(--c-success);
    filter: drop-shadow(0 0 10px rgba(42, 212, 160, 0.45));
}
.setup-section {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--surface-4);
}
.setup-section-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-1);
    margin: 0 0 var(--space-2);
}
.setup-note {
    font-size: var(--fs-xs);
    color: var(--text-2);
    line-height: 1.5;
    margin: 0 0 var(--space-2);
}
.setup-warn {
    color: var(--c-warning-text, #ffce6b);
}
.setup-ok {
    color: var(--c-success, #35c98f);
}
.setup-ok-check {
    font-weight: 700;
}
.setup-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--text-1);
    cursor: pointer;
    margin-bottom: var(--space-2);
}
.setup-check input {
    margin-top: 2px;
    flex-shrink: 0;
}
.setup-creds {
    margin-top: var(--space-2);
}
.activation-steps .step-failed {
    color: var(--c-danger-text);
    font-weight: 600;
}
