/* ═══════════════════════════════════════════════════
   ASA Swim - Guest Booking Styles
   ═══════════════════════════════════════════════════ */

:root {
    --primary: #0077B6;
    --primary-dark: #005A8C;
    --primary-light: #00B4D8;
    --accent: #00D4AA;
    --bg: #F0F8FF;
    --surface: #FFFFFF;
    --text: #1A1A2E;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* ─── Header ─── */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 24px 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.header p {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* ─── Container ─── */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 40px;
}

/* ─── Stepper ─── */
.stepper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin: 20px 0;
    padding: 0 10px;
}

.step {
    display: flex;
    align-items: center;
    gap: 0;
}

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

.step-circle.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(0, 119, 182, 0.2);
}

.step-circle.done {
    background: var(--success);
    color: white;
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    transition: all 0.3s;
}

.step-line.done {
    background: var(--success);
}

/* ─── Info Alerts ─── */
.info-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.5;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    margin-bottom: 16px;
}

.info-alert.warn {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}

.info-alert-icon {
    flex-shrink: 0;
    font-size: 1rem;
    margin-top: 1px;
}

/* ─── Cards ─── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

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

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

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

.form-control::placeholder {
    color: #9CA3AF;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* ─── Select Cards (Branch, Plan selection) ─── */
.select-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.select-card {
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}

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

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

.select-card .card-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.select-card .card-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.select-card .card-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
    margin-top: 4px;
}

/* ─── Slot Grid ─── */
.slot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.slot-card {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: var(--surface);
}

.slot-card:hover:not(.disabled) {
    border-color: var(--primary-light);
}

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

.slot-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #F9FAFB;
}

.slot-time {
    font-weight: 600;
    font-size: 0.85rem;
}

.slot-available {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.slot-available.low {
    color: var(--warning);
}

.slot-available.full {
    color: var(--danger);
}

/* ─── Phone Input ─── */
.phone-input-group {
    display: flex;
    gap: 8px;
}

.phone-input-group .dial-code {
    width: 70px;
    flex-shrink: 0;
    text-align: center;
}

.phone-input-group .phone-number {
    flex: 1;
}

/* ─── Ticket Counter ─── */
.ticket-counter {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    margin: 8px 0;
}

.ticket-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ticket-btn:hover {
    background: var(--primary);
    color: white;
}

.ticket-btn:disabled {
    border-color: var(--border);
    color: var(--border);
    cursor: not-allowed;
}

.ticket-count {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

/* ─── Summary ─── */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.summary-row.total {
    border-top: 2px solid var(--border);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
    font-size: 1.1rem;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.summary-value {
    font-weight: 600;
    font-size: 0.95rem;
}

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

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: #93C5FD;
    cursor: not-allowed;
}

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

.btn-outline:hover {
    background: #EBF5FF;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-group .btn {
    flex: 1;
}

/* ─── Loading ─── */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

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

.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-box {
    background: white;
    padding: 32px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.loading-box .spinner-lg {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.6s linear infinite;
    margin: 0 auto 16px;
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    transition: transform 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: var(--danger);
}

.toast.success {
    background: var(--success);
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ─── Booking Steps ─── */
.booking-step {
    display: none;
}

.booking-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Success Page ─── */
.success-container {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 72px;
    height: 72px;
    background: #D1FAE5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon svg {
    width: 36px;
    height: 36px;
    color: var(--success);
}

.success-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--success);
}

.success-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.booking-ref {
    display: inline-block;
    padding: 8px 16px;
    background: #F0F9FF;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.success-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-download {
    background: #F0F9FF;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-download:hover {
    background: #DBEAFE;
}

.btn-share {
    background: #D1FAE5;
    color: var(--success);
    border: 2px solid var(--success);
}

.btn-share:hover {
    background: #BBF7D0;
}

.btn-action svg {
    flex-shrink: 0;
}

.booking-details {
    text-align: left;
    margin-top: 20px;
}

.booking-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.booking-details .detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 600;
}

/* ─── Date Input ─── */
input[type="date"].form-control {
    padding: 11px 14px;
}

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

    .slot-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
