/* Login Page — NXT NVR
   Uses the same design tokens as dashboard.css */

/* ===== Login Layout ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    position: relative;
}

/* Subtle animated background grid */
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(47, 129, 247, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(47, 129, 247, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

/* ===== Login Card ===== */
.login-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    padding: 40px 36px 36px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(47, 129, 247, 0.04);
}

/* ===== Branding ===== */
.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin: 0 0 6px 0;
}

.login-brand-subtitle {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0;
}

/* ===== Form ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.login-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.login-input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.login-input::placeholder {
    color: var(--text-muted);
}

.login-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.12);
}

/* ===== Submit Button ===== */
.login-submit {
    width: 100%;
    height: 42px;
    margin-top: 4px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.login-submit:hover { opacity: 0.9; }
.login-submit:active { transform: scale(0.98); }
.login-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== Error Message ===== */
.login-error {
    display: none;
    padding: 10px 14px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 6px;
    color: var(--danger);
    font-size: 12px;
    text-align: center;
    line-height: 1.4;
}

.login-error.visible { display: block; }

/* ===== Spinner (inside button) ===== */
.login-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ===== Footer ===== */
.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* ===== Light Theme Overrides ===== */
.light .login-page::before {
    background-image:
        linear-gradient(rgba(9, 105, 218, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(9, 105, 218, 0.04) 1px, transparent 1px);
}

.light .login-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(9, 105, 218, 0.06);
}
