/**
 * Login / Signed-out Page Styles
 * Light blue GMRL design - sign-in card + BSA panel
 */

:root {
    --bg: #cfe4f2;
    --bg-circle: #e2eff9;
    --panel: #f3f8fc;
    --line: #e1e8ee;
    --ink: #2b2b2b;
    --ink-soft: #5f6368;
    --charcoal: #3d3f3e;
    --charcoal-hover: #2c2e2d;
    --yellow: #f8c700;
    --yellow-soft: #fff4c2;
    --teal: #3f8f8a;
    --green: #1e8a4a;
    --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;
    display: flex;
    flex-direction: column;
    padding: 28px 32px 32px;
    overflow-x: hidden;
    position: relative;
}

/* Decorative background circles */
.bg-circle {
    position: fixed;
    border-radius: 50%;
    background: var(--bg-circle);
    pointer-events: none;
    z-index: 0;
}

.bg-circle-tl {
    width: 540px;
    height: 540px;
    top: -270px;
    left: -170px;
}

.bg-circle-br {
    width: 440px;
    height: 440px;
    bottom: -220px;
    right: -150px;
}

/* Top bar: logo + status */
.top-bar {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1060px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: #fff;
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    box-shadow: 0 4px 14px rgba(60, 100, 140, 0.1);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(30, 138, 74, 0.5);
    animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(30, 138, 74, 0.45); }
    70%  { box-shadow: 0 0 0 7px rgba(30, 138, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(30, 138, 74, 0); }
}

/* Two-column layout */
.login-layout {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1060px;
    margin: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: stretch;
}

.login-layout > *,
.apps-grid > li {
    min-width: 0;
}

/* Left: sign-in card */
.login-card {
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(60, 100, 140, 0.18);
    padding: 44px 44px 26px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-art {
    width: 150px;
    height: auto;
    margin-bottom: 24px;
}

.eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 8px;
}

.login-card h1 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--ink);
    margin-bottom: 12px;
}

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

/* Microsoft button */
.microsoft-login-btn {
    width: 100%;
    max-width: 400px;
    min-height: 56px;
    padding: 12px 20px;
    background: var(--charcoal);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 16px rgba(61, 63, 62, 0.2);
}

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

.microsoft-login-btn:active {
    transform: scale(0.97);
}

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

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

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

/* Loading state */
.microsoft-login-btn.loading {
    pointer-events: none;
    opacity: 0.75;
}

.microsoft-login-btn.loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Underlined links (yellow) */
.alt-account,
.help-line a,
.bsa-footer a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--yellow);
    padding-bottom: 1px;
    transition: background 0.2s ease;
}

.alt-account:hover,
.help-line a:hover,
.bsa-footer a:hover {
    background: var(--yellow-soft);
}

.alt-account {
    margin-top: 26px;
    font-size: 14px;
    font-weight: 500;
}

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

.notice[hidden] {
    display: none;
}

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

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

/* Help line pinned to the card bottom */
.help-line {
    width: 100%;
    margin-top: auto;
    padding-top: 22px;
    border-top: 1px solid #ececec;
    font-size: 13.5px;
    color: var(--ink-soft);
}

.alt-account {
    margin-bottom: 36px;
}

/* Right: BSA panel */
.bsa-panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(60, 100, 140, 0.12);
    padding: 34px 32px 24px;
    display: flex;
    flex-direction: column;
}

.bsa-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 14px;
}

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

.bsa-panel h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: 22px;
}

.apps-grid {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

/* Odd count: last tile spans the full row */
.apps-grid > li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.app-tile {
    position: relative;
    height: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.app-tile:hover {
    transform: translateY(-2px);
    border-color: #d0d8df;
    box-shadow: 0 10px 22px rgba(40, 60, 80, 0.1);
}

.app-tile.is-current {
    border: 2px solid var(--yellow);
    padding: 11px 15px;
}

.app-icon {
    width: 20px;
    height: 20px;
    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);
}

.app-name {
    flex: 1;
}

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

/* What's new */
.whats-new {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
}

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

.whats-new h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.whats-new-meta {
    font-size: 12px;
    color: var(--ink-soft);
}

.whats-new-list {
    list-style: none;
}

.whats-new-list li {
    position: relative;
    padding-left: 18px;
    font-size: 13.5px;
    line-height: 1.8;
    color: #3c3c3c;
}

.whats-new-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--ink);
}

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

.bsa-footer a {
    font-size: 13px;
}

/* Responsive */
@media (max-width: 900px) {
    body {
        padding: 22px 16px 28px;
    }

    .top-bar {
        margin-bottom: 22px;
    }

    .login-layout {
        grid-template-columns: 1fr;
        max-width: 520px;
        gap: 20px;
    }

    .help-line {
        margin-top: 32px;
    }
}

@media (max-width: 480px) {
    .status-pill {
        font-size: 11.5px;
        padding: 7px 12px;
    }

    .login-card {
        border-radius: 22px;
        padding: 34px 22px 22px;
    }

    .login-card h1 {
        font-size: 27px;
    }

    .bsa-panel {
        border-radius: 22px;
        padding: 26px 18px 20px;
    }

    .bsa-panel h2 {
        font-size: 19px;
    }

    .apps-grid {
        gap: 10px;
    }

    .app-tile {
        gap: 10px;
        padding: 10px 12px;
        font-size: 12.5px;
    }

    .app-tile.is-current {
        padding: 9px 11px;
    }
}

/* ============================================================
   Animations
   ============================================================ */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.top-bar,
.login-card,
.bsa-panel,
.login-card > .eyebrow,
.login-card > h1,
.login-card > .subtitle,
.login-card > .notice,
.login-card > .microsoft-login-btn,
.login-card > .alt-account,
.apps-grid li,
.whats-new {
    animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.top-bar                           { animation-delay: 0s; }
.login-card                        { animation-delay: 0.1s; }
.bsa-panel                         { animation-delay: 0.2s; }
.login-card > .eyebrow             { animation-delay: 0.75s; }
.login-card > h1                   { animation-delay: 0.85s; }
.login-card > .subtitle            { animation-delay: 0.95s; }
.login-card > .notice              { animation-delay: 1s; }
.login-card > .microsoft-login-btn { animation-delay: 1.05s; }
.login-card > .alt-account         { animation-delay: 1.15s; }
.apps-grid li                      { animation-delay: calc(0.45s + var(--i, 0) * 0.07s); }
.whats-new                         { animation-delay: 0.95s; }

/* Toolbox illustration builds itself */
.hero-art .art-box,
.hero-art .art-lid,
.hero-art .art-ticket {
    transform-box: fill-box;
    transform-origin: 50% 100%;
}

@keyframes boxRise {
    from { opacity: 0; transform: scaleY(0.2); }
    to   { opacity: 1; transform: scaleY(1); }
}

@keyframes lidDrop {
    0%   { opacity: 0; transform: translateY(-26px); }
    70%  { opacity: 1; transform: translateY(2px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes ticketPop {
    0%   { opacity: 0; transform: translateX(14px) rotate(6deg); }
    100% { opacity: 1; transform: translateX(0) rotate(0); }
}

@keyframes drawStroke {
    from { stroke-dashoffset: 1; }
    to   { stroke-dashoffset: 0; }
}

.hero-art .art-box    { animation: boxRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both; }
.hero-art .art-lid    { animation: lidDrop 0.5s ease-out 0.55s both; }
.hero-art .art-ticket { animation: ticketPop 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.8s both; }

.hero-art .art-tick {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: drawStroke 0.3s ease-out both;
}

.hero-art .art-tick-1 { animation-delay: 1.1s; }
.hero-art .art-tick-2 { animation-delay: 1.35s; }

/* Background circles drift */
@keyframes driftA {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(30px, 24px) scale(1.06); }
}

@keyframes driftB {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-26px, -30px) scale(1.08); }
}

.bg-circle-tl { animation: driftA 22s ease-in-out infinite; }
.bg-circle-br { animation: driftB 28s ease-in-out infinite; }

/* Light sweep across the sign-in button on hover */
.microsoft-login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}

.microsoft-login-btn:hover::before {
    animation: shine 0.8s ease-out;
}

@keyframes shine {
    from { left: -60%; }
    to   { left: 130%; }
}

/* Connecting state - Microsoft squares pulse in turn */
.microsoft-login-btn.loading .microsoft-icon path {
    animation: squarePulse 1s ease-in-out infinite;
}

.microsoft-login-btn.loading .microsoft-icon path:nth-child(2) { animation-delay: 0.15s; }
.microsoft-login-btn.loading .microsoft-icon path:nth-child(4) { animation-delay: 0.3s; }
.microsoft-login-btn.loading .microsoft-icon path:nth-child(3) { animation-delay: 0.45s; }

@keyframes squarePulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.25; }
}

/* Respect the "reduce motion" accessibility setting */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .hero-art .art-tick {
        stroke-dashoffset: 0;
    }
}
