@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --primary: hsl(226, 95%, 45%);
    --primary-light: hsl(226, 95%, 96%);
    --primary-dark: hsl(226, 95%, 35%);
    --accent: hsl(142, 70%, 45%);
    --background: hsl(210, 20%, 98%);
    --surface: hsl(0, 0%, 100%);
    --text: hsl(224, 71%, 4%);
    --text-muted: hsl(220, 9%, 45%);
    --border: hsl(220, 13%, 91%);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #0f172a;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Desktop Frame Simulator */
.phone-frame {
    width: 412px;
    height: 892px;
    background-color: var(--background);
    border: 12px solid #1e293b;
    border-radius: 48px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5), 0 0 0 4px #334155;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* iPhone Notch */
.notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 30px;
    background-color: #1e293b;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 100;
}

/* Status Bar */
.status-bar {
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px 0 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    z-index: 90;
    user-select: none;
}

.status-bar .icons {
    display: flex;
    gap: 6px;
}

/* App Container */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Onboarding Screen */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--background);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 20;
}

/* Carousel Styles */
.onboarding-carousel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px;
}

.carousel-slides {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.slide {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.slide.active {
    display: flex;
}

.slide-image {
    width: 240px;
    height: 240px;
    margin-bottom: 32px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide-image svg {
    width: 120px;
    height: 120px;
    color: var(--primary);
}

.slide-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.2;
}

.slide-desc {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.5;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    width: 24px;
    border-radius: 4px;
    background-color: var(--primary);
}

/* Common Header Styles */
.app-header {
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
}

.app-header .title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.app-header .actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--border);
    color: var(--primary);
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 2px solid var(--primary);
}

/* Scrollable Container */
.scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: none;
}

.scroll-content::-webkit-scrollbar {
    display: none;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 15px;
    background-color: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--surface);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

/* Tab Bar Navigation */
.tab-bar {
    height: 72px;
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: 8px;
    z-index: 50;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    flex: 1;
    transition: color 0.2s;
}

.tab-item.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-item svg {
    width: 24px;
    height: 24px;
}

/* Cards & Widgets */
.premium-card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary);
}

.insurance-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--surface);
    padding: 20px;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.insurance-card::before {
    display: none;
}

.insurance-card .chip {
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: 0.8;
}

/* Floating Actions */
.fab {
    position: absolute;
    bottom: 88px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background-color: var(--primary);
    color: var(--surface);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    border: none;
    z-index: 40;
    transition: transform 0.2s;
}

.fab:hover {
    transform: scale(1.05);
}

/* Accordion & Lists */
.list-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
}

.list-item-row:last-child {
    border-bottom: none;
}

.list-item-row .details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.list-item-row .title {
    font-size: 15px;
    font-weight: 600;
}

.list-item-row .subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Expandable Accordion */
.accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    overflow: hidden;
}

.accordion-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
    background-color: var(--surface);
    transition: background-color 0.2s;
}

.accordion-header:hover {
    background-color: var(--primary-light);
}

.accordion-body {
    padding: 16px;
    background-color: var(--background);
    border-top: 1px solid var(--border);
    display: none;
    font-size: 14px;
    line-height: 1.6;
}

.accordion.active .accordion-body {
    display: block;
}

/* Modals */
.modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 150;
    animation: fadeIn 0.2s ease;
}

.modal-sheet {
    width: 100%;
    background-color: var(--surface);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: 24px;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Persistent debug selector */
.debug-switcher {
    position: absolute;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 200;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
}

.debug-switcher label {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.debug-switcher select {
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 600;
    outline: none;
    color: var(--text);
    cursor: pointer;
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Skeleton Loading Loader */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-text {
    height: 12px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    width: 60%;
    border-radius: 4px;
    margin-bottom: 12px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive layout adjustments */
@media (max-width: 480px) {
    body {
        background-color: var(--background);
    }
    .phone-frame {
        width: 100vw;
        height: 100vh;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    .notch {
        display: none;
    }
    .status-bar {
        padding-top: 6px;
    }
}
