/* =====================================================================
   Reset & Custom Properties
   ===================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:             #08080f;
    --surface:        #0e0e1c;
    --border:         rgba(255, 255, 255, 0.07);
    --border-focus:   rgba(0, 204, 204, 0.5);
    --text:           #e8e8f5;
    --muted:          #5a5a7a;
    --accent:         #00999999;
    --accent-hover:   #00cccc;
    --radius:         10px;
}

/* =====================================================================
   Base
   ===================================================================== */
html {
    font-size: 16px;
    height: 100%;
}

body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

/* Subtle radial glow from top centre */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 70% 40% at 50% 0%, rgba(0, 204, 204, 0.07), transparent);
    pointer-events: none;
    z-index: 0;
}

/* =====================================================================
   Layout Shell
   ===================================================================== */
header, footer {
    flex-shrink: 0;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 2rem;
}

/* =====================================================================
   Login Page
   ===================================================================== */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    width: 100%;
    animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =====================================================================
   Brand
   ===================================================================== */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 360px;
    height: auto;
}

.tagline {
    margin: -20px 0 0 0;
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--muted);
}

/* =====================================================================
   Login Card
   ===================================================================== */
.login-card {
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
}

/* =====================================================================
   Form Fields
   ===================================================================== */
.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.4rem;
}

.field label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.field input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0.45rem 0;
    font-size: 0.95rem;
    color: var(--text);
    font-family: inherit;
    outline: none;
    width: 100%;
    transition: border-color 0.2s ease;
}

.field input:focus {
    border-bottom-color: var(--accent);
}

/* Override Chrome autofill background on dark themes */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100px var(--surface) inset;
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
}

/* =====================================================================
   Login Error Message
   ===================================================================== */
.login-error {
    font-size: 0.8rem;
    color: #e05c5c;
    margin-bottom: 0.75rem;
    min-height: 1.2em;
}

/* =====================================================================
   Shake animation — failed login attempt
   ===================================================================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-5px); }
    80%       { transform: translateX(5px); }
}

.login-card.shake {
    animation: shake 0.4s ease;
}

/* =====================================================================
   Submit Button
   ===================================================================== */
button[type="submit"] {
    width: 100%;
    padding: 0.7rem 1rem;
    margin-top: 0.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, filter 0.3s ease;
}

button[type="submit"]:hover {
    background: var(--accent-hover);
}

button[type="submit"]:active {
    transform: scale(0.98);
}

button[type="submit"]:disabled {
    filter: grayscale(1) opacity(0.45);
    pointer-events: none;
    cursor: default;
}
