/* PDS Auth Platform - Login page styles
   Matches the visual style of PDS Resolve login page. */

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

:root {
    --pds:        #003B5C;
    --pds-light:  #004d75;
    --pds-pale:   #e6eff5;
    --border:     #c8d6df;
    --text:       #1a2a33;
    --muted:      #5d7382;
    --red:        #dc2626;
    --ms-blue:    #0078d4;
    --ms-hover:   #106ebe;
}

html, body {
    height: 100%;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    background: var(--pds);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px 44px;
    width: 360px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    text-align: center;
}

/* ── Logo ────────────────────────────────────────────────────────────────── */

.login-logo {
    margin-bottom: 24px;
}

.login-logo img {
    width: 100%;
    height: auto;
    display: block;
}

/* App logo + PDS badge together */
.login-logo-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.login-logo-app .app-logo {
    width: 100%;
    height: auto;
    max-height: 64px;
    object-fit: contain;
    display: block;
}

.login-logo-app .pds-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}

.login-logo-app .pds-badge img {
    height: 14px;
    width: auto;
    opacity: 0.65;
}

/* ── Headings ─────────────────────────────────────────────────────────────── */

.login-title {
    font-weight: 700;
    font-size: 20px;
    color: var(--pds);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.login-sub {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 28px;
}

/* ── Fields ──────────────────────────────────────────────────────────────── */

.login-field {
    margin-bottom: 16px;
    text-align: left;
}

.login-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 5px;
}

.login-field input {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font: 15px Inter, sans-serif;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
    -webkit-appearance: none;
}

.login-field input:focus {
    border-color: var(--pds);
    box-shadow: 0 0 0 3px rgba(0, 59, 92, 0.1);
}

.login-field input::placeholder {
    color: #9cb3c0;
}

/* ── Remember / checkbox row ─────────────────────────────────────────────── */

.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    text-align: left;
}

.remember-row input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--pds);
    flex-shrink: 0;
}

.remember-row label {
    font-size: 12.5px;
    color: var(--muted);
    cursor: pointer;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* ── Error ───────────────────────────────────────────────────────────────── */

.login-error {
    color: var(--red);
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 14px;
    min-height: 18px;
    text-align: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.login-btn {
    width: 100%;
    padding: 11px;
    background: var(--pds);
    color: #fff;
    border: none;
    border-radius: 6px;
    font: 700 14px Inter, sans-serif;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.login-btn:hover:not(:disabled) { background: var(--pds-light); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Microsoft variant */
.login-btn-ms {
    background: var(--ms-blue);
    margin-top: 10px;
}
.login-btn-ms:hover:not(:disabled) { background: var(--ms-hover); }

/* ── Divider ─────────────────────────────────────────────────────────────── */

.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Back / forgot links ─────────────────────────────────────────────────── */

.login-back {
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    background: none;
    border: none;
    margin-top: 10px;
    text-decoration: underline;
    padding: 0;
    font-family: Inter, sans-serif;
    display: inline-block;
}
.login-back:hover { color: var(--pds); }

/* ── 2FA code input ──────────────────────────────────────────────────────── */

.code-input {
    letter-spacing: 6px;
    font-size: 22px !important;
    text-align: center;
    font-weight: 700;
}

.login-hint {
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ── Spinner (inline in button) ──────────────────────────────────────────── */

.btn-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
    flex-shrink: 0;
}
.loading .btn-spinner { display: block; }
.loading .btn-label   { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Panels ──────────────────────────────────────────────────────────────── */

.panel { display: none; }
.panel.active { display: block; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 420px) {
    .login-box { width: 100%; margin: 1rem; padding: 32px 28px; }
}
