/*
 * Sign-in and workspace-picker styling.
 *
 * Palette is taken from the product itself: #b71c1c is the red already used for the application
 * sidebar, and the logo's dominant colour samples at #901818 - so the auth screens now open in
 * the same brand colour the user lands in, instead of an unrelated navy.
 *
 * Kept out of the Gentelella theme file so a theme upgrade cannot restyle authentication.
 */
:root {
    --brand: #b71c1c;
    --brand-dark: #8e1616;
    --brand-deep: #5f0f0f;
    --brand-tint: rgba(183, 28, 28, .10);
    --ink: #23272e;
    --muted: #6d7683;
    --line: #e2e6ec;
}

/* The old rule set 100vh height AND 24px padding without border-box, so every screen was
   48px too tall and grew a scrollbar. */
.auth-body, .auth-body *, .auth-body *::before, .auth-body *::after { box-sizing: border-box; }

body.auth-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #eceff3;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--ink);
    overflow-x: hidden;
}

.auth-card {
    display: flex;
    width: 100%;
    max-width: 1000px;
    /* Bounded by the viewport so the card itself never forces the page to scroll. */
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 44px rgba(35, 39, 46, .16);
}

/* ---- brand panel ---- */
.auth-brand {
    position: relative;
    flex: 0 0 42%;
    padding: 34px 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(158deg, #c62828 0%, var(--brand) 42%, var(--brand-deep) 100%);
    color: #fff;
}
.auth-brand:before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 82% 14%, rgba(255, 255, 255, .09) 0 130px, transparent 131px),
        radial-gradient(circle at 8% 88%, rgba(0, 0, 0, .10) 0 170px, transparent 171px);
    pointer-events: none;
}
.auth-logo {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
    position: relative;
    flex: none;
}
.auth-logo img { max-width: 38px; max-height: 38px; }
.auth-brand-copy { position: relative; }
.auth-brand-copy h1 {
    font-size: 27px; font-weight: 700; margin: 0 0 12px; letter-spacing: -.4px;
}
.auth-brand-copy p {
    font-size: 13.5px; line-height: 1.65;
    color: rgba(255, 255, 255, .86); margin: 0;
}

/* ---- form panel ---- */
.auth-panel {
    flex: 1 1 58%;
    padding: 38px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    overflow-y: auto;
}
.auth-panel h2 { font-size: 21px; font-weight: 700; margin: 0 0 4px; }
.auth-panel .auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; line-height: 1.5; }

.auth-field { margin-bottom: 15px; }
.auth-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.auth-field .form-control {
    height: 44px; width: 100%;
    border: 1px solid var(--line); border-radius: 7px;
    box-shadow: none; font-size: 14px; padding: 0 14px;
    background: #fff; color: var(--ink);
}
.auth-field .form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint);
}
.auth-input-wrap { position: relative; }
.auth-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px;
}
.auth-btn {
    width: 100%; height: 46px; border: 0; border-radius: 7px;
    background: var(--brand); color: #fff; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: background .15s ease;
}
.auth-btn:hover { background: var(--brand-dark); }
.auth-btn-ghost {
    display: block; width: 100%; height: 42px; line-height: 40px; text-align: center;
    border: 1px solid var(--line); border-radius: 7px; color: var(--muted);
    background: #fff; margin-top: 10px; font-size: 14px; text-decoration: none;
}
.auth-btn-ghost:hover { border-color: #cfd6e0; color: var(--ink); text-decoration: none; }
.auth-row { display: flex; align-items: center; justify-content: flex-end; margin: 2px 0 18px; }
.auth-link {
    color: var(--brand); text-decoration: none; background: none;
    border: 0; padding: 0; cursor: pointer; font-size: 13px;
}
.auth-link:hover { text-decoration: underline; }
.auth-alert {
    border-radius: 7px; padding: 10px 13px; font-size: 13px;
    margin-bottom: 15px; border: 1px solid transparent;
}
.auth-alert-danger { background: #fdecec; border-color: #f3c4c4; color: #96201f; }
.auth-alert-success { background: #e9f7f1; border-color: #bae4d5; color: #1c7a5d; }
.auth-alert-info { background: #eef3fa; border-color: #cbdcf0; color: #2a5b8d; }
.auth-foot { margin-top: 20px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---- workspace picker ---- */
.auth-panel--picker { justify-content: flex-start; }
.workspace-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.workspace-back {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    margin-top: 2px;
}
.workspace-back:hover {
    border-color: var(--brand);
    color: var(--brand);
    text-decoration: none;
}
.workspace-head { flex: none; }
.workspace-search {
    height: 42px; width: 100%;
    border: 1px solid var(--line); border-radius: 7px;
    padding: 0 12px; margin-bottom: 6px; font-size: 14px;
}
.workspace-search:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}
.workspace-count { font-size: 12px; color: var(--muted); margin: 0 0 10px; }

/* The list scrolls inside the card rather than pushing the page taller. */
.workspace-list { flex: 1 1 auto; overflow-y: auto; margin: 0 -6px; padding: 2px 6px; min-height: 0; }
.auth-group-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
    color: var(--muted); font-weight: 700; margin: 14px 0 7px;
}
.auth-group-label:first-child { margin-top: 0; }

/* Two across, so 50+ stations are a couple of flicks rather than a long crawl. */
.workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.workspace-grid.is-wide { grid-template-columns: minmax(0, 1fr); }

.workspace-item {
    display: flex; align-items: center; width: 100%; text-align: left;
    border: 1px solid var(--line); border-radius: 8px; background: #fff;
    padding: 10px 12px; cursor: pointer; color: var(--ink); text-decoration: none;
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
    min-width: 0;
}
.workspace-item:hover {
    border-color: var(--brand);
    box-shadow: 0 3px 10px rgba(183, 28, 28, .12);
    transform: translateY(-1px);
    text-decoration: none; color: var(--ink);
}
.workspace-item.is-primary { border-color: rgba(183,28,28,.35); background: #fffafa; }
.workspace-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 10px; flex: none; font-size: 13px;
}
.workspace-icon.is-major { background: rgba(52, 152, 219, .14); color: #2f80c2; }
.workspace-icon.is-reservor { background: rgba(155, 89, 182, .14); color: #8e44ad; }
.workspace-icon.is-regular { background: rgba(26, 187, 156, .14); color: #12967d; }
.workspace-icon.is-allregular { background: var(--brand-tint); color: var(--brand); }
.workspace-text { min-width: 0; }
.workspace-name {
    display: block; font-size: 13.5px; font-weight: 600; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.workspace-meta {
    display: block; font-size: 11px; color: var(--muted); margin-top: 1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.workspace-go { margin-left: auto; color: #c2c9d3; padding-left: 6px; }
.workspace-item:hover .workspace-go { color: var(--brand); }
.workspace-empty { color: var(--muted); font-size: 13px; padding: 14px 2px; }
.workspace-foot { flex: none; padding-top: 14px; }

@media (max-width: 900px) {
    body.auth-body { padding: 0; }
    .auth-card { flex-direction: column; max-height: none; border-radius: 0; min-height: 100vh; }
    .auth-brand { flex: none; padding: 24px; }
    .auth-brand-copy h1 { font-size: 22px; }
    .auth-panel { padding: 26px 22px; }
    .workspace-grid { grid-template-columns: minmax(0, 1fr); }
}
