/*
   minidp login page styling — "Deep Water".

   A tranquil teal design palette: light mode is the sunlit shallows (cool
   seafoam neutrals), dark mode is the deep (ocean surfaces, a single glowing
   emerald). The token scale lives in the design showcase (palette.css); this
   stylesheet is self-contained so the login page needs exactly one request.

   Dark mode follows the OS preference (prefers-color-scheme); no JavaScript.
   Operators can replace this file and the logo at runtime: place login.css
   and/or logo.svg into the fixed "assets" directory next to the working
   directory — each present file overrides its embedded default (see README).
*/

/* ============================================
   THEME TOKENS — the shallows (light)
   ============================================ */
:root {
    color-scheme: light;

    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display",
                 "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial,
                 sans-serif;

    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-full: 999px;

    --bg:        #eff4f2;
    --surface:   #ffffff;
    --inset:     #e3eae7;

    --text:      #14201d;
    --text-2:    #4f615c;
    --text-3:    #5f746b;
    --on-accent: #ffffff;

    --border:        #b9c8c1;
    --divider:       #d7e1dd;

    --accent:        #0d8570;
    --accent-strong: #0a6d5b;
    --accent-hover:  #0c7362;
    --accent-soft:   #e4f2ee;
    --accent-glow:   rgba(15, 138, 114, 0.16);
    --light-glow:    rgba(24, 179, 157, 0.22);

    --danger:      #c3492f;
    --danger-soft: #f7e6e2;

    --shadow-sm: 0 1px 2px rgba(14, 38, 32, 0.05), 0 1px 3px rgba(14, 38, 32, 0.04);
    --shadow-md: 0 6px 16px rgba(14, 38, 32, 0.08), 0 2px 6px rgba(14, 38, 32, 0.05);
}

/* ============================================
   THEME TOKENS — the deep (dark)
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        --bg:        #061411;
        --surface:   #0c221d;
        --inset:     #081a16;

        --text:      #e9f1ee;
        --text-2:    #a6bdb6;
        --text-3:    #7fa097;
        --on-accent: #04140f;

        --border:        rgba(233, 241, 238, 0.16);
        --divider:       rgba(233, 241, 238, 0.06);

        --accent:        #18b39d;
        --accent-strong: #2ad1b8;
        --accent-hover:  #1fc5ad;
        --accent-soft:   rgba(24, 179, 157, 0.14);
        --accent-glow:   rgba(24, 179, 157, 0.28);
        --light-glow:    rgba(24, 179, 157, 0.18);

        --danger:      #e87168;
        --danger-soft: rgba(232, 113, 104, 0.16);

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
        --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45), 0 3px 8px rgba(0, 0, 0, 0.30);
    }
}

/* ============================================
   BASE
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(130% 70% at 50% -8%, var(--light-glow), transparent 58%),
        var(--bg);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-glow);
    border-radius: var(--r-sm);
}

/* ============================================
   LAYOUT
   ============================================ */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.start-content {
    text-align: center;
    padding: 2rem;
    max-width: 440px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* ============================================
   BRAND
   ============================================ */
.landing-logo {
    width: 120px;
    height: auto;
    margin-bottom: 0.25rem;
    filter: drop-shadow(0 4px 12px var(--accent-glow));
    transition: transform 0.2s ease;
}

.landing-logo:hover {
    transform: scale(1.04);
}

.main-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.1rem;
    background: linear-gradient(180deg, var(--text), var(--accent-strong));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 0.75rem;
    color: var(--text-3);
}

/* ============================================
   LOGIN CARD
   ============================================ */
#login-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    width: 100%;
    text-align: center;
}

.login-message {
    color: var(--text-2);
}

.login-message p {
    line-height: 1.5;
}

.login-error {
    color: var(--danger);
    background: var(--danger-soft);
    border-radius: var(--r-sm);
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

/* ============================================
   FORM
   ============================================ */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.form-row input {
    font: inherit;
    color: var(--text);
    background: var(--inset);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    padding: 0.7rem 0.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease,
                background-color 0.15s ease;
}

.form-row input::placeholder {
    color: var(--text-3);
}

.form-row input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--r-full);
    transition: transform 0.12s ease, background-color 0.2s ease,
                box-shadow 0.2s ease;
}

.action-btn.login-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    background: var(--accent-strong);
    color: var(--on-accent);
    box-shadow: 0 6px 18px var(--accent-glow);
}

.action-btn.login-btn:hover {
    background: var(--accent-hover);
}

.action-btn.login-btn:active {
    transform: translateY(1px) scale(0.99);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .landing-logo {
        width: 96px;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .start-content {
        padding: 1.5rem 1rem;
    }

    #login-container {
        padding: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
