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

:root {
    --primary: #2572FC;
    --primary-hover: #1e5cc9;
    --text-dark: #222222;
    --text-light: #666666;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-pill: 50px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.app-main {
    padding: 3rem 1rem;
    min-height: 100vh;
}

.app-layout {
    display: flex;
    max-width: 1000px;
    margin: 0 auto;
    gap: 2rem;
    align-items: flex-start;
}

.app-container {
    flex: 1;
    min-width: 0;
    width: 100%;

}

.sidebar-nav {
    flex: 0 0 260px;
    position: sticky;
    top: 2rem;
    height: fit-content;
    background: var(--card-bg);
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.nav-tracker {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.nav-tracker::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 19px;
    width: 2px;
    background: var(--border-color);
    z-index: 1;
}

.nav-tracker::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 19px;
    width: 2px;
    background: var(--primary);
    z-index: 1;
    transition: height 0.4s ease;
    height: calc((100% - 40px) * var(--tracker-progress, 0));
}

.nav-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
    padding-bottom: 2.5rem;
    cursor: pointer;
}

.nav-step:last-child {
    padding-bottom: 0;
}

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

.step-icon svg {
    width: 18px;
    height: 18px;
}

.step-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.nav-step.active .step-icon,
.nav-step.completed .step-icon {
    border-color: var(--primary);
    color: var(--primary);
    background: rgb(215 229 255);
}

.nav-step.active .step-label {
    color: var(--text-dark);
    font-weight: 600;
}

.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}



.app-header p {
    color: var(--text-light);
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 1px dashed #cbd5e1;
    color: #64748b;
    flex-shrink: 0;
}

.section-icon svg {
    width: 20px;
    height: 20px;
}

.section-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 48px;
}

.section-title h3 {
    font-size: 1.15rem;
    margin: 0 0 0.2rem 0;
    padding: 0;
    border: none;
    color: var(--text-dark);
    font-weight: 600;
}

.section-title p {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label,
.section-label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    display: block;
}

.input-group input {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-color);
    color: var(--text-dark);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 114, 252, 0.15);
}

.input-group input::placeholder {
    color: #aaa;
}

/* Date Input Wrapper */
.date-input-wrapper {
    position: relative;
    width: 100%;
}

.date-input-wrapper input[type="date"] {
    width: 100%;
    box-sizing: border-box;
}

.date-input-wrapper .date-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
}

/* Hide native icon visually but keep it clickable on top */
.date-input-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* Pills */
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pill {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.pill:hover {
    border-color: #ccc;
}

.pill.active {
    /* background: var(--primary); */
    border-color: var(--primary);
    color: var(--primary);

}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

/* Signature */
.signature-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: var(--bg-color);
}

#signature-pad {
    width: 100%;
    height: 200px;
    background: white;
    cursor: crosshair;
    display: block;
}

.clear-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s;
}

.clear-btn:hover {
    background: var(--text-dark);
}

/* Button */
.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
}

.submit-btn:hover {
    background: var(--primary-hover);


}

.submit-btn:focus {
    outline: none;

}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loader */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

.hidden {
    display: none !important;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.form-message {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-width: 350px;
    animation: slideInUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

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

.form-message.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* PWA Pull to Refresh */
.pwa-refresh-indicator {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    color: var(--primary);
    pointer-events: none;
}

.pwa-refresh-indicator svg {
    width: 20px;
    height: 20px;
}

.pwa-refresh-indicator.ready {
    color: #166534;
}

.pwa-refresh-indicator.refreshing svg {
    animation: spin 1s linear infinite;
}

@media (max-width: 900px) {
    .app-container {
        margin-top: 20px;
    }

    .app-layout {
        flex-direction: column;
        gap: 0;
    }

    .sidebar-nav {
        flex: none;
        position: sticky;
        top: 1.5rem;
        width: 100%;
        margin: 0 0 1.5rem 0;
        height: auto;
        padding: 1.5rem;
        z-index: 99;
        background: var(--card-bg);
        border-radius: var(--radius);
        border: 1px solid rgba(0, 0, 0, 0.02);
        box-shadow: var(--shadow);
        box-sizing: border-box;
    }

    .nav-tracker {
        display: flex;
        justify-content: space-between;
        flex-direction: row;
    }

    .nav-tracker::before {
        top: 20px;
        left: 20px;
        right: 20px;
        bottom: auto;
        height: 2px;
        width: auto;
    }

    .nav-tracker::after {
        top: 20px;
        left: 20px;
        height: 2px;
        width: calc((100% - 40px) * var(--tracker-progress, 0));
        transition: width 0.4s ease;
    }

    .nav-step {
        padding-bottom: 0;
        flex-direction: column;
        gap: 0.5rem;
        flex: none;
        justify-content: center;
    }

    .step-label {
        display: none;
    }

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

    .app-main {
        padding: 0 1rem 1.5rem 1rem;
    }

    .card {
        padding: 1.5rem;
    }
}