/**
 * Login / Signed-out Page Styles
 * HR 360 Appraisal - BSA two-panel design
 */

:root {
    --bg: #cfe4f2;
    --bg-circle: #e2eff9;
    --ink: #2b2b2b;
    --ink-soft: #5f6368;
    --charcoal: #3d3f3e;
    --charcoal-hover: #2c2e2d;
    --yellow: #f8c700;
    --teal: #3a7f87;
    --panel: #f3f8fc;
    --line: #dde6ee;
    --info-bg: #fff4c2;
    --ok: #1e8e4a;
    --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;
    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 + system status */
.top-bar {
    position: relative;
    z-index: 1;
    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 7px 5px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    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 16px;
    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(--ok);
    animation: statusPulse 2.4s ease-out infinite;
}

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

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

/* 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 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-art {
    width: 156px;
    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: 10px;
}

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

/* 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;
    text-decoration: none;
    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,
.other-account-link:focus-visible,
a.app-card:focus-visible,
.bsa-foot 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); }
}

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

/* 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: start;
    font-size: 14px;
    line-height: 1.55;
}

.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;
}

/* Card footer: help line + languages */
.card-foot {
    width: 100%;
    margin-top: auto;
    padding-top: 40px;
}

.card-foot::before {
    content: '';
    display: block;
    border-top: 1px solid #e6e8ea;
    margin-bottom: 18px;
}

.help-line {
    font-size: 13.5px;
    color: var(--ink-soft);
}

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

.help-line a:hover,
.other-account-link:hover,
.bsa-foot a:hover {
    background: var(--info-bg);
}

.language-selector {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
    color: #b5bbc1;
}

.language-selector a {
    color: var(--ink-soft);
    text-decoration: none;
}

.language-selector a:hover,
.language-selector a.active {
    color: var(--ink);
    font-weight: 600;
}

/* Right: BSA panel */
.bsa-panel {
    background: var(--panel);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: 28px;
    padding: 30px 32px 24px;
    display: flex;
    flex-direction: column;
}

.bsa-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #4a4f55;
    margin-bottom: 14px;
}

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

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

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

.app-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px 16px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.app-card:hover {
    transform: translateY(-2px);
    border-color: #c9d6e1;
    box-shadow: 0 10px 22px rgba(40, 70, 100, 0.12);
}

.app-card.is-current {
    border: 2px solid var(--yellow);
    box-shadow: 0 6px 16px rgba(248, 199, 0, 0.18);
}

.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-name {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
}

.app-card.is-wide {
    grid-column: 1 / -1;
}

.app-name small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--ink-soft);
}

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

.whats-new {
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px 12px;
}

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

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

.whats-new-head span {
    font-size: 12.5px;
    color: var(--ink-soft);
}

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

.whats-new li {
    font-size: 13.5px;
    line-height: 1.75;
    color: #3c3c3c;
}

.whats-new li::before {
    content: '\2713';
    margin-right: 6px;
    color: var(--teal);
    font-weight: 700;
}

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

/* Responsive: stack the panels */
@media (max-width: 900px) {
    .top-bar,
    .login-layout {
        max-width: 520px;
    }

    .login-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 20px 16px 28px;
    }

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

    .status-pill {
        font-size: 12px;
        padding: 7px 12px;
    }

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

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

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

    .apps-grid {
        grid-template-columns: 1fr;
    }
}

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

/* 1. Staggered fade-up on load */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.top-bar,
.login-card,
.login-card > .eyebrow,
.login-card > h1,
.login-card > .subtitle,
.login-card > .notice,
.login-card > .microsoft-login-btn,
.login-card > .other-account-link,
.login-card > .card-foot,
.bsa-panel,
.app-card,
.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; }
.app-card:nth-child(1)             { animation-delay: 0.45s; }
.app-card:nth-child(2)             { animation-delay: 0.5s; }
.app-card:nth-child(3)             { animation-delay: 0.55s; }
.app-card:nth-child(4)             { animation-delay: 0.6s; }
.app-card:nth-child(5)             { animation-delay: 0.65s; }
.app-card:nth-child(6)             { animation-delay: 0.7s; }
.app-card:nth-child(7)             { animation-delay: 0.75s; }
.login-card > .eyebrow             { animation-delay: 0.75s; }
.whats-new                         { animation-delay: 0.8s; }
.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 > .other-account-link  { animation-delay: 1.15s; }
.login-card > .card-foot           { animation-delay: 1.25s; }

/* 2. HR 360 illustration builds itself */
.hero-art .art-person,
.hero-art .art-ring,
.hero-art .art-bubble,
.hero-art .art-tag {
    transform-box: fill-box;
}

.hero-art .art-person { transform-origin: 50% 100%; }
.hero-art .art-ring   { transform-origin: 50% 50%; }
.hero-art .art-bubble { transform-origin: 10% 100%; }
.hero-art .art-tag    { transform-origin: 50% 50%; }

@keyframes personRise {
    from { opacity: 0; transform: translateY(14px) scale(0.6); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ringSpin {
    from { opacity: 0; transform: rotate(-120deg) scale(0.8); }
    to   { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes bubblePop {
    0%   { opacity: 0; transform: scale(0.3); }
    70%  { opacity: 1; transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes tagSlide {
    0%   { opacity: 0; transform: translateX(16px) rotate(8deg); }
    100% { opacity: 1; transform: translateX(0) rotate(0); }
}

/* Stars: outline draws, then the yellow fills in */
@keyframes drawStar {
    0%   { stroke-dashoffset: 1; fill-opacity: 0; }
    70%  { stroke-dashoffset: 0; fill-opacity: 0; }
    100% { stroke-dashoffset: 0; fill-opacity: 1; }
}

.hero-art .art-person { animation: personRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both; }
.hero-art .art-ring   { animation: ringSpin 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both; }
.hero-art .art-bubble { animation: bubblePop 0.5s ease-out 0.75s both; }
.hero-art .art-tag    { animation: tagSlide 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.95s both; }

.hero-art .art-star {
    fill: #f8c700;
    stroke: #3d3f3e;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: drawStar 0.4s ease-out both;
}

.hero-art .art-star-1 { animation-delay: 1.15s; }
.hero-art .art-star-2 { animation-delay: 1.35s; }
.hero-art .art-star-3 { animation-delay: 1.55s; }

/* 3. Background circles drift and breathe */
@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; }

/* 4. 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%; }
}

/* 5. 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-star {
        stroke-dashoffset: 0;
    }
}
