/**
 * Solario24 Pickup System - Booking Styles
 * Official Solario24 Branding
 */

:root {
    /* Solario24 Brand Colors */
    --primary: #7DB441;
    --primary-dark: #6a9a38;
    --primary-light: #8fc44f;
    --accent: #e6b82f;
    --accent-dark: #c9a128;
    --accent-light: #f0c94a;

    /* Status Colors */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --text-dark: #2d2d2d;

    /* Design Tokens */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #f8faf5 0%, #ffffff 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-img {
    height: 52px;
    margin-bottom: 12px;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-700);
    letter-spacing: -0.02em;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    padding: 0 20px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    background: var(--gray-200);
    color: var(--gray-500);
    transition: all 0.3s;
}

.step-circle.active {
    background: var(--primary);
    color: white;
}

.step-circle.completed {
    background: var(--primary);
    color: white;
}

.step-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
    display: none;
}

@media (min-width: 480px) {
    .step-label {
        display: block;
    }
}

.step-label.active {
    color: var(--primary-dark);
}

.progress-line {
    flex: 1;
    height: 3px;
    background: var(--gray-200);
    border-radius: 2px;
    max-width: 60px;
}

.progress-line.completed {
    background: var(--primary);
}

/* Code Entry Container */
.code-entry-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--error);
}

.error-icon {
    font-size: 1.5rem;
}

.code-entry-box {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px 24px;
    border: 1px solid var(--gray-100);
}

.code-entry-box h2 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.code-entry-box > p {
    color: var(--gray-600);
    margin-bottom: 20px;
}

.code-form {
    margin-bottom: 24px;
}

.code-input-group {
    display: flex;
    gap: 8px;
}

.code-input-group input {
    flex: 1;
    padding: 14px 16px;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.code-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(125, 180, 65, 0.2);
}

.code-input-group input::placeholder {
    text-transform: none;
    letter-spacing: normal;
    color: var(--gray-400);
}

.btn-verify {
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-verify:hover {
    background: var(--primary-dark);
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.info-text {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin-top: 16px;
}

.contact-info {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    border: 1px solid var(--gray-100);
}

.contact-info h3 {
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.contact-info p {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin-bottom: 8px;
}

.contact-info a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 500;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Success Container */
.success-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px 24px;
    text-align: center;
    border: 1px solid var(--gray-100);
}

.success-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 16px;
}

.success-container h2 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 24px;
}

.booking-details {
    text-align: left;
    margin-bottom: 24px;
}

.pickup-code-display {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.pickup-code-display .label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
    margin-bottom: 4px;
}

.pickup-code-display .code {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

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

.detail-item {
    padding: 14px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-100);
}

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

.detail-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.detail-value {
    font-weight: 500;
    color: var(--gray-800);
}

.info-box {
    background: linear-gradient(135deg, #f0f9e8 0%, #e8f5dc 100%);
    border: 1px solid rgba(125, 180, 65, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.info-box p {
    color: var(--gray-700);
    font-size: 0.9375rem;
    margin: 0;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    transition: background 0.2s;
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

/* Items List Display (in booking confirmation) */
.items-list-display {
    margin-top: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-100);
}

.items-list-display h4 {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 10px;
}

.items-list-display ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.items-list-display li {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    gap: 10px;
    font-size: 0.9375rem;
}

.items-list-display li:last-child {
    border-bottom: none;
}

.items-list-display .qty {
    font-weight: 600;
    color: var(--primary-dark);
    min-width: 32px;
}

.items-list-display .name {
    color: var(--gray-700);
}

/* Order Info */
.order-info {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--gray-100);
}

.order-info h2 {
    font-size: 1.25rem;
    color: var(--gray-900);
}

.customer-name {
    color: var(--gray-600);
    margin-bottom: 16px;
}

.items-list h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.items-list ul {
    list-style: none;
}

.items-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    gap: 10px;
}

.items-list li:last-child {
    border-bottom: none;
}

.items-list .qty {
    font-weight: 600;
    color: var(--primary-dark);
    min-width: 32px;
}

.items-list .name {
    color: var(--gray-700);
}

.solar-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.solar-warning .warning-icon {
    font-size: 1.5rem;
    color: var(--accent-dark);
    flex-shrink: 0;
}

.solar-warning strong {
    color: var(--gray-800);
}

.weight-info {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--gray-200);
    font-weight: 500;
}

.weight-info .value {
    color: var(--primary-dark);
    font-weight: 600;
}

/* Booking Form */
.booking-form {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    border: 1px solid var(--gray-100);
}

.booking-form h2 {
    font-size: 1.125rem;
    margin-bottom: 20px;
    color: var(--gray-800);
}

.calendar-container {
    margin-bottom: 24px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.nav-btn {
    padding: 8px 16px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.current-range {
    font-weight: 600;
    color: var(--gray-800);
}

.days-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.day-btn {
    padding: 12px 8px;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.day-btn:hover:not(:disabled) {
    background: #f0f9e8;
    border-color: var(--primary-light);
}

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

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

.day-btn .day-name {
    display: block;
    font-size: 0.75rem;
    color: inherit;
    opacity: 0.7;
}

.day-btn .day-date {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
}

.select-day-hint {
    text-align: center;
    color: var(--gray-500);
    padding: 24px;
}

.slots-container {
    min-height: 100px;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.slot-btn {
    padding: 12px;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.slot-btn:hover:not(:disabled) {
    background: #f0f9e8;
    border-color: var(--primary);
}

.slot-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.slot-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.slots-loading {
    text-align: center;
    color: var(--gray-500);
    padding: 24px;
}

/* Additional Info */
.additional-info {
    border-top: 1px solid var(--gray-200);
    padding-top: 24px;
    margin-top: 24px;
}

.additional-info h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--gray-700);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(125, 180, 65, 0.2);
}

.btn-book {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    margin-top: 8px;
}

.btn-book:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-book:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 16px;
    color: var(--gray-600);
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.footer a {
    color: var(--primary-dark);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Error Container (Legacy) */
.error-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px 24px;
    text-align: center;
}

.error-container h2 {
    color: var(--error);
    margin-bottom: 16px;
}

.error-container p {
    color: var(--gray-600);
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 16px 12px;
    }

    .days-container {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .day-btn {
        padding: 8px 4px;
    }

    .day-btn .day-date {
        font-size: 1rem;
    }

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

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

    .progress-bar {
        padding: 0 8px;
    }
}
