/* ============================================================================
   Clio Operate — startup splash
   Dark navy theme to match the wizard's brand band: navy surface,
   white-on-transparent portal logo, Poppins typography, brand-coloured
   task states (teal complete, orange errored, blue primary CTA).
   ============================================================================ */

:root {
    --navy:      #04304C;
    --navy-deep: #062a40;
    --blue:      #0070E0;
    --blue-deep: #005AB8;
    --teal:      #018B76;
    --orange:    #D74417;
    --paper:     #FFFFFF;

    --font: 'Poppins', 'Barlow', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--font);
    font-weight: 400;
    color: white;
    background-color: var(--navy);
    background-image:
        radial-gradient(ellipse 60% 80% at 0% 0%, rgba(0, 112, 224, 0.22), transparent 60%),
        radial-gradient(ellipse 50% 80% at 100% 100%, rgba(1, 139, 118, 0.18), transparent 60%),
        linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    position: relative;
}

/* Subtle paper-grain cross-hatch — matches the wizard band */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 14px);
    pointer-events: none;
    z-index: 0;
}

/* Hairline brand stripe at top, mirroring the wizard band rule */
body::after {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--teal) 20%,
        var(--blue) 50%,
        var(--teal) 80%,
        transparent 100%);
    opacity: 0.72;
    z-index: 1;
    pointer-events: none;
}

/* ----------------------------------------------------------------------------
   Layout
   ---------------------------------------------------------------------------- */

div.container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-rows: 100vh;
}

div.contents {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 16px;
    grid-auto-flow: row;
    align-items: center;
    padding: 32px;
    animation: rise-in 0.55s cubic-bezier(0.21, 0.62, 0.36, 1) both;
}

@keyframes rise-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------------------------
   Logo
   ---------------------------------------------------------------------------- */

img.logo {
    max-width: 280px;
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 8px;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.12));
    opacity: 0.96;
    animation: rise-in 0.55s cubic-bezier(0.21, 0.62, 0.36, 1) 0.08s both;
}

/* ----------------------------------------------------------------------------
   Progress strip — animated brand-coloured sweep
   ---------------------------------------------------------------------------- */

.progress-strip {
    width: 260px;
    height: 3px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    margin: 4px 0 4px;
    animation: rise-in 0.55s cubic-bezier(0.21, 0.62, 0.36, 1) 0.16s both;
}

.progress-strip-bar {
    position: absolute;
    top: 0;
    left: -40%;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--blue), var(--teal), transparent);
    border-radius: 99px;
    animation: progress-sweep 1.8s ease-in-out infinite;
}

@keyframes progress-sweep {
    0%   { left: -40%; }
    100% { left: 105%; }
}

/* ----------------------------------------------------------------------------
   Loading message
   ---------------------------------------------------------------------------- */

span.message {
    text-align: center;
    font-family: var(--font);
    font-weight: 300;
    font-size: 22px;
    letter-spacing: -0.005em;
    color: rgba(255, 255, 255, 0.92);
    margin-top: 4px;
    animation: rise-in 0.55s cubic-bezier(0.21, 0.62, 0.36, 1) 0.24s both;
}

/* ----------------------------------------------------------------------------
   Task list — pill-style cards on translucent overlay
   ---------------------------------------------------------------------------- */

ul.task-list {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: min(700px, calc(100vw - 64px));
}

ul.task-list > li {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    font-family: var(--font);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.01em;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    animation: task-fade-in 0.35s ease both;
    position: relative;
}

@keyframes task-fade-in {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Errored — Clio orange accent, dimmed surface */
ul.task-list > li.errored {
    background: rgba(215, 68, 23, 0.14);
    border-color: rgba(215, 68, 23, 0.55);
    color: #FFC8B5;
}

ul.task-list > li.errored::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--orange);
    color: white;
    font-weight: 700;
    font-size: 11px;
    margin-right: 10px;
    flex-shrink: 0;
}

/* Complete — teal accent, checkmark */
ul.task-list > li.complete {
    background: rgba(1, 139, 118, 0.18);
    border-color: rgba(1, 139, 118, 0.45);
    color: rgba(255, 255, 255, 0.78);
}

ul.task-list > li.complete::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 10px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 7.5l3 3 7-7'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* Fade-out when removed */
.hidden {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s 0.45s;
}

/* ----------------------------------------------------------------------------
   Retry actions — brand-coloured buttons
   ---------------------------------------------------------------------------- */

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0 4px;
    justify-content: center;
}

a.retry-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

a.retry-button-primary {
    background: var(--blue);
    color: white;
    border: 1px solid var(--blue);
    box-shadow: 0 2px 6px rgba(0, 112, 224, 0.30);
}

a.retry-button-primary:hover {
    background: var(--blue-deep);
    border-color: var(--blue-deep);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 112, 224, 0.36);
}

a.retry-button-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 112, 224, 0.30);
}

a.retry-button-ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

a.retry-button-ghost:hover {
    background: rgba(255, 255, 255, 0.10);
    color: white;
    border-color: rgba(255, 255, 255, 0.65);
}

/* Fallback for any retry-button without primary/ghost modifier */
a.retry-button:not(.retry-button-primary):not(.retry-button-ghost) {
    background: var(--blue);
    color: white;
    border: 1px solid var(--blue);
}

/* ----------------------------------------------------------------------------
   Reduced motion
   ---------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ----------------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------------- */

@media (max-width: 640px) {
    img.logo {
        max-width: 220px;
    }

    span.message {
        font-size: 18px;
    }

    .actions {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
    }

    a.retry-button {
        width: 100%;
    }
}
