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

:root {
    --primary-color: #3c5e40;
    --primary-hover: #2d4630;
    --secondary-bg: #f8faf9;
    --border-color: #e5e7eb;
    --text-dark: #111827;
    --text-gray: #4b5563;
    --text-muted: #9ca3af;
    --white: #ffffff;
    --accent-light: #e8f5e9;
    --error: #ef4444;
    --font-main: 'Outfit', sans-serif;
    --sidebar-width: 320px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    background-color: var(--white);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
}

.onboarding-container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--secondary-bg);
    border-right: 1px solid var(--border-color);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-logo img {
    height: 32px;
    margin-bottom: 60px;
}

.progress-list {
    list-style: none;
    position: relative;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.progress-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 30px;
    height: 40px;
    width: 2px;
    background-color: var(--border-color);
    z-index: -1;
}

.progress-item.completed::before {
    background-color: var(--primary-color);
}

.progress-item:last-child::before {
    display: none;
}

.step-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--white);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    padding: 3px;
}

.progress-item.completed .step-indicator {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.progress-item.active .step-indicator {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.step-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 0;
}

.progress-item.active .step-info h4 {
    color: var(--primary-color);
}

.progress-item.completed .step-info h4 {
    color: var(--text-dark);
}

.step-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
}

/* Main Panel Styling */
.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 60px 80px;
    overflow-y: auto;
    position: relative;
}

.onboarding-screen {
    max-width: 600px;
    margin: auto;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    display: none;
}

.onboarding-screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.screen-header h2 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.screen-header p {
    font-size: 18px;
    color: var(--text-gray);
    margin-bottom: 40px;
}

/* Form Elements */
.option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 40px;
}

.option-button {
    background: var(--white);
    border: 2px solid var(--border-color);
    padding: 24px;
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 18px;
    font-weight: 600;
}

.option-button:hover {
    border-color: var(--primary-color);
    background-color: var(--secondary-bg);
}

.option-button.selected {
    border-color: var(--primary-color);
    background-color: var(--accent-light);
}

.input-field {
    width: 100%;
    padding: 16px 20px;
    font-size: 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.country-dropdown {
    position: relative;
    width: 100%;
}

.country-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
    background: #fff;
    margin-bottom: 0;
}

.country-trigger-label {
    color: var(--text-dark);
    font-weight: 500;
}

.country-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    z-index: 40;
    overflow: hidden;
}

.country-dropdown.open .country-menu {
    display: block;
}

.country-search-wrap {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--secondary-bg);
}

.country-search-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
}

.country-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.country-options {
    max-height: 280px;
    overflow-y: auto;
}

.country-option {
    width: 100%;
    border: none;
    background: #fff;
    text-align: left;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text-dark);
    cursor: pointer;
    font-family: inherit;
}

.country-option:hover {
    background: var(--secondary-bg);
}

/* Multi-select Cards */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 40px;
}

.select-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-card:hover {
    background-color: var(--secondary-bg);
}

.select-card.selected {
    border-color: var(--primary-color);
    background-color: var(--accent-light);
}

.checkbox-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-circle svg {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.select-card.selected .checkbox-circle {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.select-card.selected .checkbox-circle svg {
    opacity: 1;
}

.card-info h5 {
    font-size: 16px;
    font-weight: 600;
}

/* Footer Actions */
.onboarding-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.btn-continue {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 18px 48px;
    border-radius: 50px;
    border: none;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-continue:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-continue:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-back {
    color: var(--text-gray);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    margin-bottom: 20px;
    width: fit-content;
}

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

.btn-back i {
    transition: transform 0.2s ease;
}

.btn-back:hover i {
    transform: translateX(-4px);
}

.btn-skip {
    color: var(--text-gray);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
}

/* Repeatable Medication Form */
.med-item {
    background: var(--secondary-bg);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    position: relative;
    border: 1px solid var(--border-color);
}

.btn-remove-med {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-remove-med:hover {
    background-color: var(--error);
    color: var(--white);
}

.med-row {
    margin-bottom: 16px;
}

.day-selector {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.day-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-bubble:hover {
    border-color: var(--primary-color);
}

.day-bubble.selected {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.day-bubble.all-days {
    width: auto;
    padding: 0 16px;
    border-radius: 20px;
}

.field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Habit Tag Selector */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 42px;
}

.tag-item {
    background-color: var(--accent-light);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--primary-color);
    animation: fadeIn 0.3s ease;
}

.tag-remove {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tag-remove:hover {
    opacity: 1;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    min-height: 42px;
}

.habit-input-group {
    display: flex;
    gap: 12px;
}

.habit-input-group .input-field {
    margin-bottom: 0;
    flex: 1;
}

.btn-add-habit {
    background-color: var(--secondary-bg);
    border: 2px solid var(--border-color);
    color: var(--text-dark);
    padding: 0 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-habit:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.btn-add-more {
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: 1px dashed var(--primary-color);
    padding: 12px 24px;
    border-radius: 12px;
    width: 100%;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.micro-info {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
}

/* Animations */
.step-fade-enter {
    opacity: 0;
    transform: translateX(20px);
}

.step-fade-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.4s ease;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-panel {
        padding: 40px 24px;
    }

    .screen-header h2 {
        font-size: 32px;
    }

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

/* Account Creation Styles */
.phone-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.country-code-select {
    width: 140px;
    padding: 16px 12px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    background-color: var(--white);
}

.country-code-select-wrap {
    position: relative;
    width: 140px;
    flex: 0 0 140px;
}

.country-code-select-wrap .country-code-select {
    width: 100%;
}

.country-code-select--compact {
    color: transparent !important;
    text-shadow: none;
}

.country-code-select--compact option {
    color: var(--text-dark);
}

.country-code-display {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    pointer-events: none;
}

.country-code-display.is-empty {
    color: var(--text-muted);
    font-weight: 500;
}

.phone-number-input {
    flex: 1;
    margin-bottom: 0 !important;
}

.field-helper {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    margin-top: 4px;
}

.otp-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
    animation: slideUp 0.4s ease;
}

.otp-label {
    display: block;
    text-align: left;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.otp-input-group {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    margin-bottom: 24px;
}

.otp-box {
    width: 48px;
    height: 56px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--secondary-bg);
}

.otp-box:focus {
    border-color: var(--primary-color);
    background: var(--white);
    outline: none;
}

@media (max-width: 480px) {
    .otp-input-group {
        gap: 8px;
        justify-content: space-between;
    }

    .otp-box {
        width: 40px;
        height: 48px;
        font-size: 20px;
        border-radius: 10px;
    }
}

.resend-container {
    text-align: left;
    margin-top: 16px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
}

.btn-text:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.change-link {
    display: block;
    text-align: left;
    margin-top: 16px;
    color: var(--text-gray);
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
}

.loading-dots {
    display: inline-block;
    width: 24px;
    text-align: left;
}

.loading-dots:after {
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '';
    }

    40% {
        content: '.';
    }

    60% {
        content: '..';
    }

    80%,
    100% {
        content: '...';
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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