/**
 * Sign-in / signed-out page styles (shared/login-page.js)
 * Light blue GMRL BSA design - two panels: sign-in card + BSA apps panel
 */

:root {
    --bg: #cfe4f2;
    --panel: #f3f8fc;
    --ink: #2b2b2b;
    --ink-soft: #5f6368;
    --line: #dfe6ec;
    --charcoal: #3d3f3e;
    --charcoal-hover: #2c2e2d;
    --yellow: #f8c700;
    --teal: #2f7f86;
    --error-bg: #fde4e1;
    --error-ink: #b42318;
}

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

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    padding: 32px 24px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

a { color: inherit; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Top bar ---------- */
.top-bar {
    width: 100%;
    max-width: 1060px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.brand-box {
    border: 1.5px solid #555;
    padding: 6px 7px 5px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 3px;
    line-height: 1.35;
    color: #555;
    text-align: center;
}

.top-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(30, 60, 90, 0.08);
}

.top-pill svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: var(--teal);
    stroke-width: 2.2;
    stroke-linecap: round;
}

/* ---------- Layout ---------- */
.login-layout {
    width: 100%;
    max-width: 1060px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 28px;
    align-items: stretch;
}

/* ---------- Sign-in card ---------- */
.login-card {
    background: #fff;
    border-radius: 28px;
    padding: 48px 44px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 20px 50px rgba(30, 60, 90, 0.12);
    animation: rise 0.5s ease both;
}

.hero-art {
    width: 160px;
    height: 100px;
    margin-top: auto; /* with .help-line's auto top margin, centres the card content */
    margin-bottom: 26px;
}

.art-tick {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 0.4s ease forwards;
}
.art-tick-1 { animation-delay: 0.35s; }
.art-tick-2 { animation-delay: 0.55s; }
.art-tick-3 { animation-delay: 0.75s; }

.eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

h1 {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 14px;
}

.subtitle {
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink-soft);
    max-width: 340px;
    margin-bottom: 26px;
}

.login-btn {
    width: 100%;
    max-width: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: var(--charcoal);
    color: #fff;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.login-btn:hover {
    background: var(--charcoal-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.login-btn:focus-visible,
.alt-link:focus-visible,
.app-tile:focus-visible,
.help-line a:focus-visible,
.bsa-footer a:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}

.login-btn.loading {
    pointer-events: none;
    opacity: 0.85;
}

.login-btn.loading .ms-icon-tile {
    animation: pulse 0.9s ease-in-out infinite;
}

.ms-icon-tile {
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.microsoft-icon {
    width: 18px;
    height: 18px;
}

.alt-link {
    margin-top: 24px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid var(--yellow);
    padding-bottom: 1px;
}

.alt-link:hover { color: #000; }

.notice {
    width: 100%;
    max-width: 400px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-align: left;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 18px;
}

.notice-error {
    background: var(--error-bg);
    color: var(--error-ink);
}

.notice-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.help-line {
    width: 100%;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid #ececec;
    font-size: 13px;
    color: var(--ink-soft);
}

/* keeps the divider clear of the link when the card is short */
.login-card .alt-link { margin-bottom: 40px; }

.help-line a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--yellow);
}

/* ---------- BSA panel ---------- */
.bsa-panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    padding: 34px 32px 26px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(30, 60, 90, 0.08);
    animation: rise 0.5s ease 0.08s both;
}

.bsa-kicker {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #4a4d4c;
    margin-bottom: 18px;
}

.bsa-badge {
    background: var(--yellow);
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 5px;
}

.bsa-panel h2 {
    font-size: 23px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 22px;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.app-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    animation: rise 0.4s ease both;
    animation-delay: calc(0.15s + var(--i, 0) * 0.04s);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

a.app-tile:hover {
    border-color: #b9c9d6;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(30, 60, 90, 0.08);
}

.app-tile.is-current {
    grid-column: 1 / -1;
    border: 2px solid var(--yellow);
    font-weight: 600;
}

.app-icon {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--teal);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-tile.is-current .app-icon { stroke: var(--charcoal); }

.current-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--yellow);
    margin-left: auto;
    flex-shrink: 0;
}

.whats-new {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 22px;
}

.whats-new-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
}

.whats-new h3 {
    font-size: 15px;
    font-weight: 600;
}

.whats-new-head span {
    font-size: 12px;
    color: var(--ink-soft);
    white-space: nowrap;
}

.whats-new ul {
    list-style: none;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

.whats-new li {
    position: relative;
    padding-left: 20px;
    margin-top: 5px;
}

.whats-new li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--teal);
    font-weight: 700;
}

.bsa-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--ink-soft);
}

.bsa-footer a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--yellow);
}

/* ---------- Motion ---------- */
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes draw {
    to { stroke-dashoffset: 0; }
}

@keyframes pulse {
    50% { transform: scale(0.85); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        transition: none !important;
    }
    .art-tick { stroke-dashoffset: 0; }
}

/* ---------- Narrow screens: stack the panels ---------- */
@media (max-width: 900px) {
    .login-layout {
        grid-template-columns: 1fr;
        max-width: 520px;
    }
    .top-bar { max-width: 520px; }
}

@media (max-width: 480px) {
    body { padding: 20px 16px 32px; }
    .top-pill { font-size: 12px; padding: 7px 12px; }
    .login-card { padding: 36px 22px 22px; border-radius: 22px; }
    .bsa-panel { padding: 26px 18px 20px; border-radius: 22px; }
    h1 { font-size: 30px; }
    .app-grid { grid-template-columns: 1fr; }
}
