/*
 * Sign-in pages (login.php, forgot_password.php).
 * The background video and the floating logo (.video-background, .video-overlay,
 * .logo-mark / logoFloat) are deliberately unchanged from the original login page.
 */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, sans-serif; }

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --text-dark: #1e293b;
    --text-light: #64748b;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    background-color: #0f172a;
}

.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.video-background video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.75) 0%, rgba(30, 41, 59, 0.65) 100%);
    z-index: -1;
    backdrop-filter: blur(3px);
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.logo-mark {
    text-align: center;
    margin-bottom: 28px;
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-mark img {
    height: 64px;
    width: auto;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5)) brightness(0) invert(1);
}

.logo-mark p {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.card-header {
    text-align: center;
    margin-bottom: 35px;
}

.card-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.card-header p {
    color: var(--text-light);
    font-size: 15px;
}

.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 16px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
    color: var(--text-dark);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.password-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
    font-size: 18px;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-wrapper label {
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    user-select: none;
}

.forgot-pass {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.forgot-pass:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.btn-signin {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-signin::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-signin:hover::before {
    left: 100%;
}

.btn-signin:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
}

.btn-signin:active {
    transform: translateY(0);
}

.btn-signin:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.card-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e2e8f0;
}

.card-footer p {
    font-size: 14px;
    color: var(--text-light);
}

.card-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.card-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.security-notice {
    background: rgba(71, 85, 105, 0.06);
    border: 1px solid rgba(71, 85, 105, 0.15);
    border-radius: 10px;
    padding: 12px;
    margin-top: 20px;
    display: flex;
    align-items: start;
    gap: 10px;
}

.security-notice i {
    color: var(--primary-color);
    font-size: 16px;
    margin-top: 2px;
}

.security-notice p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }

    .card-header h1 {
        font-size: 24px;
    }

    .logo-mark {
        font-size: 38px;
    }
}

/* ── Additions ─────────────────────────────────────────────────────────── */

/* Show-password is now a real button */
.toggle-password {
    border: 0;
    background: none;
    padding: 6px;
    line-height: 1;
    border-radius: 8px;
}
.toggle-password:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 1px; }
.input-group input.has-toggle { padding-right: 48px; }

.caps-warning {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #b45309;
}
.caps-warning.show { display: flex; }

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.lock-timer { font-variant-numeric: tabular-nums; font-weight: 700; }

.card-header p.sub-note {
    margin-top: 10px;
    font-size: 13.5px;
    line-height: 1.55;
}

/* Primary button: centred label + an icon chip on the right that moves on hover
   and holds the spinner while the form is sending. */
.btn-signin {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 7px 7px 7px 22px;
    border-radius: 14px;
    font-size: 15.5px;
    letter-spacing: 0.01em;
    background: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 45%, #3b82f6 100%);
    background-size: 180% 100%;
    background-position: 0% 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 12px 24px -10px rgba(29, 78, 216, 0.7);
    transition: background-position 0.45s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-signin .btn-label {
    flex: 1;
    text-align: center;
    padding-left: 40px;   /* the chip's width, so the label sits in the true centre */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-chip {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.22);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
}
.btn-chip .loading { margin-left: 0; }
.btn-signin:hover:not(:disabled) {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 16px 30px -12px rgba(29, 78, 216, 0.8);
}
.btn-signin:hover:not(:disabled) .btn-chip {
    transform: translateX(3px);
    background: rgba(255, 255, 255, 0.25);
}
.btn-signin.chip-send:hover:not(:disabled) .btn-chip { transform: translate(3px, -2px) rotate(-8deg); }
.btn-signin:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.btn-signin:disabled {
    opacity: 1;
    background: linear-gradient(120deg, #94a3b8, #a8b4c6);
    box-shadow: none;
}
.btn-signin:disabled:hover { transform: none; box-shadow: none; }
.btn-signin:disabled::before { display: none; }
.btn-signin:disabled .btn-chip { background: rgba(255, 255, 255, 0.18); }
.btn-signin.is-busy:disabled { background: linear-gradient(120deg, #1e3a8a, #2563eb); }

/* Card footer: secondary action along the bottom edge of the card */
.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 28px -40px -40px;
    padding: 14px 18px 14px 40px;
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.55), rgba(241, 245, 249, 0.95));
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 20px 20px;
    font-size: 13.5px;
    color: var(--text-light);
}
.foot-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 16px 5px 5px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.foot-arrow {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: #eff6ff;
    color: var(--primary-color);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, color 0.2s ease;
}
.foot-link:hover { border-color: #bfdbfe; box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.45); }
.foot-link:hover .foot-arrow { transform: translateX(-3px); background: var(--primary-color); color: #fff; }
@media (max-width: 480px) {
    .card-foot { margin: 24px -20px -30px; padding: 12px 12px 12px 20px; }
}

.btn-signin:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.45); outline-offset: 2px; }
.forgot-pass:focus-visible, .foot-link:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) {
    .btn-signin, .btn-chip, .foot-arrow { transition: none; }
}

/* Is this a registered office PC? (login.php, once the sign-in gate is on) */
.pc-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.45;
}
.pc-check i { margin-top: 2px; flex-shrink: 0; }
.pc-check[data-state="ok"]   { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.pc-check[data-state="warn"] { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.pc-check[data-state="bad"]  { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
