/* =====================================================
   Alpaca OS — Login (1:1 with ALPACA_OS_Login_01_Orange_Horizon.html)
   Class names prefixed `aos-` to scope from the rest of the app.
   ===================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    width: 100%; height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.aos-page {
    min-height: 100vh;
    display: flex; flex-direction: column;
    position: relative;
    overflow: hidden;
}

.aos-bg {
    position: fixed; inset: 0; z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Dark fallback prevents white edges when the image's aspect ratio
       doesn't cover the viewport, or while the image is still loading. */
    background-color: #1a1a1a;
}
.aos-overlay { position: fixed; inset: 0; z-index: 1; }
/* Subtle veil for legibility — was .18 (too white-washed). */
.aos-veil    { position: fixed; inset: 0; z-index: 2; background: rgba(0,0,0,.10); }

/* Topbar */
.aos-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 44px;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid #e8e2da;
    position: relative; z-index: 4;
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.aos-ver { font-size: 11px; color: #999; }

/* Main centered card */
.aos-main {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 2rem; position: relative; z-index: 4;
    min-height: calc(100vh - 100px);
}
.aos-card {
    border-radius: 22px;
    width: 600px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.85);
    display: flex;
    box-shadow: 0 16px 64px rgba(0,0,0,.18), 0 2px 12px rgba(0,0,0,.08);
}

/* Left brand panel (cl) */
.aos-cl {
    padding: 2.25rem 1.75rem;
    width: 215px; flex-shrink: 0;
    background: rgba(255,248,242,.97);
    border-right: 1px solid rgba(232,114,42,.10);
    display: flex; flex-direction: column;
}
.aos-fl {
    font-size: 10px; color: #ccc;
    letter-spacing: .07em; text-transform: uppercase;
    margin-bottom: 10px; margin-top: 1.25rem;
}
.aos-fi { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.aos-fd {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent, #ff8c42);
    flex-shrink: 0;
}
.aos-ft { font-size: 13px; color: #888; }

/* Right form panel (cr) */
.aos-cr {
    background: rgba(255,255,255,.98);
    padding: 2.25rem 2rem;
    flex: 1;
    display: flex; flex-direction: column; justify-content: center;
}
.aos-stt {
    font-size: 22px; font-weight: 600; color: #1a1a1a;
    text-align: center; margin-bottom: 5px;
}
.aos-sss {
    font-size: 12px; color: #bbb;
    text-align: center; margin-bottom: 1.75rem;
}

.aos-iw { position: relative; margin-bottom: 12px; }
.aos-inp {
    width: 100%;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 9px;
    padding: 12px 38px 12px 38px;
    font-size: 14px; color: #222;
    outline: none;
    font-family: inherit;
    transition: border-color .15s, background .15s;
}
.aos-inp:focus {
    border-color: var(--accent, #ff8c42);
    background: #fff;
}
.aos-inp::placeholder { color: #ccc; }
.aos-ii {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: inline-flex;
}
.aos-eye {
    position: absolute; right: 8px; top: 50%;
    transform: translateY(-50%);
    background: transparent; border: 0;
    cursor: pointer;
    padding: 4px 6px;
    display: inline-flex; align-items: center;
}

.aos-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.aos-ck {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: #aaa; cursor: pointer;
}
.aos-fp {
    font-size: 12px;
    color: var(--accent, #ff8c42);
    text-decoration: none;
}
.aos-fp:hover { text-decoration: underline; }

.aos-login-btn {
    width: 100%;
    padding: 10px;
    background: var(--accent, #ff8c42);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .02em;
    transition: background .2s;
    line-height: 1.3;
}
.aos-login-btn:hover { background: var(--accent-dark, #e8722a); }

.aos-note {
    font-size: 11px; color: #ccc;
    text-align: center;
    margin-top: 14px;
    line-height: 1.5;
}
.aos-alert {
    background: #fef2f2;
    color: #ff8c42;
    border: 1px solid #fecaca;
    border-radius: 9px;
    padding: 9px 14px;
    font-size: 12px;
    text-align: center;
    margin-bottom: 12px;
}

/* Footer */
.aos-pf {
    padding: 10px 44px;
    border-top: 1px solid #e8e2da;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,.94);
    position: relative; z-index: 4;
}
.aos-pft { font-size: 10px; color: #aaa; }
.aos-sta {
    display: flex; align-items: center; gap: 5px;
    font-size: 10px; color: #4a9a4a;
}
.aos-sdot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #6dbf6d;
}

/* Test/preview cycle controls (bottom-right) */
.aos-bgtest {
    position: fixed;
    bottom: 56px;
    right: 24px;
    z-index: 5;
    display: flex; align-items: center; gap: 4px;
    padding: 3px 5px;
    background: rgba(255,255,255,.92);
    border: 1px solid #e8e2da;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    font-size: 10.5px;
}
.aos-bgtest-btn {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 0;
    background: #ff8c42;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.aos-bgtest-btn:hover { background: #e8722a; }
.aos-bgtest-label {
    min-width: 0;
    max-width: 160px;
    text-align: center;
    color: #555;
    font-weight: 600;
    padding: 0 .35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aos-bgtest-save {
    width: auto !important;
    height: 22px !important;
    border-radius: 11px !important;
    padding: 0 .55rem !important;
    font-size: 10.5px !important;
    font-weight: 600;
    line-height: 22px;
}
.aos-bgtest-hint {
    font-size: 10.5px;
    font-weight: 600;
    margin-left: .35rem;
}

/* =====================================================
   RESPONSIVE — login screen
   ===================================================== */

/* Tablet / small laptop: shrink the 600px fixed card width to fit */
@media (max-width: 820px) {
    .aos-card { width: 92%; max-width: 560px; }
    .aos-cl { width: 180px; padding: 1.75rem 1.25rem; }
    .aos-cr { padding: 1.75rem 1.5rem; }
    .aos-topbar { padding: 10px 20px; }
}

/* Phone (portrait + landscape) — stack brand panel above form */
@media (max-width: 640px) {
    .aos-card {
        flex-direction: column;
        width: 100%;
        max-width: 440px;
        border-radius: 16px;
        margin: 0 auto;
    }
    .aos-cl {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid rgba(232,114,42,.10);
        padding: 1.25rem 1.5rem;
        text-align: center;
        align-items: center;
    }
    .aos-cl > img { margin: 0 auto; }
    /* Hide the "Features" list on small phones to save vertical space —
       form fields stay above the fold */
    .aos-fl, .aos-fi { display: none; }
    .aos-cr { padding: 1.5rem 1.25rem; }

    .aos-topbar { padding: 8px 14px; }
    .aos-topbar img { height: 24px !important; }
    .aos-ver { font-size: 10px; }

    .aos-main { padding: 1rem; min-height: calc(100vh - 80px); }

    .aos-stt { font-size: 18px; }
    .aos-sss { font-size: 11px; margin-bottom: 1.25rem; }
}

/* Very small phones (iPhone SE etc.) */
@media (max-width: 380px) {
    .aos-cl { padding: 1rem 1rem; }
    .aos-cr { padding: 1.25rem 1rem; }
    .aos-card { border-radius: 12px; }
    .aos-inp { padding: 10px 36px 10px 36px; font-size: 13px; }
    .aos-login-btn { padding: 12px 0; font-size: 14px; }
    .aos-topbar { display: none; }   /* maximize vertical space */
    .aos-main { min-height: 100vh; padding: .75rem; }
}

/* Landscape phone — keep card compact, scroll if needed */
@media (max-height: 480px) and (orientation: landscape) {
    .aos-main { align-items: flex-start; padding-top: 1rem; min-height: auto; }
    .aos-card { margin: 1rem auto; }
    .aos-fl, .aos-fi { display: none; }   /* hide features to fit */
}

/* Touch-friendly: bigger inputs/buttons on any touch device */
@media (pointer: coarse) {
    .aos-inp { padding-top: 14px; padding-bottom: 14px; font-size: 15px; }
    .aos-login-btn { padding: 14px 0; font-size: 15px; }
    .aos-eye { padding: 8px 10px; }
}
