:root {
    --primary: #4a4a4a;
    /* Dark gray primary */
    --primary-light: #6b6b6b;
    --primary-dark: #2f2f2f;
    --background: #f3f4f6;
    /* Light gray background */
    --surface: #ffffff;
    --surface-light: #f9fafb;
    --border: #e2e8f0;
    --border-focus: #4a4a4a;
    --text-primary: #1f2937;
    /* Dark slate */
    --text-secondary: #4b5563;
    /* Mid slate */
    --text-muted: #9ca3af;
    --success: #10b981;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #f3f4f6;
    color: var(--text-primary);
    line-height: 1.5;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

.form-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 48px;
    box-shadow: var(--shadow);
    position: relative;
}

/* Progress Bar */
.progress-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #f3f4f6;
    border-radius: 12px 12px 0 0;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    width: 0%;
    border-radius: 12px 0 0 0;
}

/* Steps */
.step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.step-content {
    padding-top: 8px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
    font-weight: 400;
}

.helper-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin: -20px 0 24px 0;
}

/* Info Box - Improved */
.info-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 24px 0;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
}

.info-box p {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
}

.info-box strong {
    font-weight: 600;
    color: #1e293b;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
    display: grid;
    gap: 8px;
}

.info-box li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    font-size: 14px;
    line-height: 1.4;
}

.reminder-card .info-title {
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.reminder-list .icon-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.reminder-list .icon-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 14px;
    color: #f59e0b;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"] {
    width: 100%;
    padding: 10px 14px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

input:hover {
    border-color: #d1d5db;
}

input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder {
    color: var(--text-muted);
}

small {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 400;
}

/* Time Slot Selection */
.time-slot-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.time-slot {
    background: white;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.time-slot:hover {
    border-color: var(--primary-light);
    background: #f3f4f6;
}

.time-slot.selected {
    border-color: var(--primary);
    background: #e5e5e5;
}

.time-slot-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.time-slot-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.time-slot-time {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.summary-section {
    background: #f9fafb;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.summary-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.summary-item {
    padding: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.summary-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}

.summary-value {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
}

.autocomplete-list {
    position: relative;
    margin-top: 4px;
}

.autocomplete-list .autocomplete-items {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 10;
    overflow: hidden;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

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

.autocomplete-item:hover {
    background: #f3f4f6;
}

.autocomplete-label {
    font-size: 14px;
    color: var(--text-primary);
}

.autocomplete-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.hidden {
    display: none;
}


/* Buttons */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 32px;
}

.btn-next,
.btn-back,
.btn-submit {
    flex: 1;
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-family: inherit;
}

.btn-next,
.btn-submit {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
}

.btn-next:hover,
.btn-submit:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-next:disabled,
.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-back {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-back:hover {
    background: var(--surface-light);
    border-color: #d1d5db;
}

/* Submit Button Loading State */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit.loading .btn-text {
    visibility: hidden;
}

.btn-submit .btn-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-submit.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Success Content */
.success-content {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.confirmation-box {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.confirmation-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}

.confirmation-number {
    font-size: 20px;
    font-weight: 700;
    color: #059669;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Error Banner */
.error-banner {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    color: #991b1b;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideDown 0.3s ease;
    max-width: 90%;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.error-banner.show {
    display: flex;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.error-banner button {
    background: none;
    border: none;
    color: #991b1b;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .form-wrapper {
        padding: 32px 24px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .time-slot-group {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

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

/* Iframe Optimization */
body.iframe-mode {
    padding: 0;
    background: white;
}

/* Date Cards Styling */
.date-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.date-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
}

.date-card:hover {
    border-color: var(--primary-light);
    background-color: #f3f4f6;
}

.date-card.selected {
    border-color: var(--primary);
    background-color: #e5e5e5;
    box-shadow: 0 0 0 1px var(--primary);
}

.date-card-day {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.date-card-date {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
}
