/* ================================================================
   LIT SOFTWARE — Shared Styles
   Matches litsoftware.com brand language
   ================================================================ */

/* ---- Reset ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---- Variables ---- */
:root {
    --navy: #1a1a2e;
    --navy-light: #2e2e6b;
    --slate: #64748b;
    --slate-light: #94a3b8;
    --border: #e2e8f0;
    --surface: #f8fafc;
    --white: #fff;
    --blue-accent: #2563eb;
    --blue-soft: #eef2ff;
    --blue-text: #1e40af;
    --green-soft: #ecfdf5;
    --green-text: #059669;
    --green-badge: #16a34a;
    --amber-soft: #fffbeb;
    --amber-text: #d97706;
    --red-soft: #fef2f2;
    --red-text: #b91c1c;
    --red-badge: #dc2626;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 50px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: 0.2s ease;
    --card-width: 480px;
}

/* ---- Body ---- */
body {
    font-family: 'Lexend Deca', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--white);
    color: var(--navy);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================================================
   HEADER
   ================================================================ */
.header {
    width: 100%;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 28px;
    width: auto;
}

.header-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--slate);
    text-decoration: none;
    transition: color var(--transition);
}

.header-link:hover {
    color: var(--navy);
}

/* ================================================================
   MAIN
   ================================================================ */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.card {
    max-width: var(--card-width);
    width: 100%;
    text-align: center;
}

/* ================================================================
   SCREEN SYSTEM
   ================================================================ */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: screenFadeIn 0.35s ease;
}

#screen-loading.active {
    animation: none;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================================================
   TYPOGRAPHY
   ================================================================ */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.subtitle {
    color: var(--slate);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 2rem;
}

.user-email {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--slate);
    margin-bottom: 1.5rem;
    letter-spacing: 0.01em;
}

/* ================================================================
   BADGES
   ================================================================ */
.offer-badge {
    display: inline-block;
    background: var(--blue-soft);
    color: var(--blue-accent);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    letter-spacing: 0.02em;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.status-active {
    background: var(--green-soft);
    color: var(--green-text);
}

.status-past-due {
    background: var(--amber-soft);
    color: var(--amber-text);
}

.status-expired {
    background: var(--red-soft);
    color: var(--red-badge);
}

/* ================================================================
   BUTTONS
   ================================================================ */

/* Apple Sign-In */
.apple-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: #000;
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
    font-family: inherit;
}

.apple-btn:hover {
    background: #1a1a1a;
}

.apple-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.apple-btn svg {
    width: 18px;
    height: 18px;
}

/* Primary — navy */
.btn-primary {
    display: inline-block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    text-decoration: none;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    background: var(--navy-light);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Secondary — navy outline */
.btn-secondary {
    display: inline-block;
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    margin-top: 0.75rem;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--slate-light);
}

/* Text link button */
.btn-text {
    display: inline-block;
    background: none;
    border: none;
    color: var(--slate);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    font-family: inherit;
    transition: color var(--transition);
    text-decoration: none;
}

.btn-text:hover {
    color: var(--navy);
}

/* Focus states */
.apple-btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-text:focus-visible {
    outline: 2px solid var(--blue-accent);
    outline-offset: 2px;
}

/* ================================================================
   SPINNER
   ================================================================ */
.spinner {
    width: 32px;
    height: 32px;
    border: 2.5px solid var(--border);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

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

/* ================================================================
   ICON CIRCLES
   ================================================================ */
.icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.icon-circle svg {
    width: 26px;
    height: 26px;
}

.icon-circle.success {
    background: var(--green-soft);
    color: var(--green-text);
}

.icon-circle.info {
    background: var(--blue-soft);
    color: var(--blue-accent);
}

.icon-circle.warning {
    background: var(--amber-soft);
    color: var(--amber-text);
}

/* ================================================================
   MESSAGE BOXES
   ================================================================ */
.error-box {
    background: var(--red-soft);
    color: var(--red-text);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    font-size: 0.88rem;
    line-height: 1.55;
    text-align: left;
}

.info-box {
    background: var(--blue-soft);
    color: var(--blue-text);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    line-height: 1.55;
    text-align: left;
}

/* ================================================================
   DASHBOARD CARD
   ================================================================ */
.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.dash-plan-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
}

.dash-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.dash-detail {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dash-detail-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-light);
}

.dash-detail-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--navy);
}

.renewal-notice {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--slate);
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}

.renewal-notice.canceling {
    color: var(--amber-text);
}

.renewal-notice.expired {
    color: var(--red-text);
}

/* ================================================================
   APP GRID
   ================================================================ */
.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.app-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--navy);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}

.app-link:hover {
    background: var(--blue-soft);
    border-color: var(--blue-accent);
}

.app-link:focus-visible {
    outline: 2px solid var(--blue-accent);
    outline-offset: 2px;
}

.app-link img {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    flex-shrink: 0;
}

.section-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--slate-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
    background: #333333;
    color: rgba(255, 255, 255, 0.6);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.8;
}

.footer-logo {
    height: 32px;
    width: auto;
    margin-bottom: 1rem;
}

.footer-links {
    margin-bottom: 0.5rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition);
}

.footer a:hover {
    color: rgba(255, 255, 255, 1);
}

.footer-divider {
    color: rgba(255, 255, 255, 0.3);
}



/* ================================================================
   RESPONSIVE
   ================================================================ */
/* ================================================================
   DEVICE WARNINGS
   ================================================================ */
.device-warning {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    text-align: left;
}

.device-warning-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.device-warning-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--slate);
    margin-top: 1px;
}

.device-warning-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.15rem;
}

.device-warning-text {
    font-size: 0.78rem;
    color: var(--slate);
    line-height: 1.5;
}

/* ================================================================
   USER INDICATOR (header dropdown)
   ================================================================ */
#user-indicator {
    position: relative;
    display: none;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.user-pill:hover {
    background: var(--border);
}

.user-pill-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--navy);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-pill-chevron {
    width: 14px;
    height: 14px;
    color: var(--slate-light);
    transition: transform var(--transition);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 100;
    overflow: hidden;
}

.user-dropdown.open {
    display: block;
}

.user-dropdown-info {
    padding: 0.65rem 1rem;
    font-size: 0.72rem;
    color: var(--slate-light);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--navy);
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition);
    font-family: inherit;
}

.user-dropdown-item:hover {
    background: var(--surface);
}

/* ================================================================
   USER NAME (account page)
   ================================================================ */
.user-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.25rem;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 520px) {
    .header {
        padding: 1rem 1.25rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .dash-details {
        grid-template-columns: 1fr;
    }

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

    .user-pill-label {
        max-width: 120px;
    }
}