/* ==========================================================================
   Wizard - Multi-Step Registration Flow
   Mobile-First Design
   ========================================================================== */

/* ---------- Progress Bar ---------- */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    counter-reset: step;
}

.wizard-progress::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    height: 2px;
    background: #ddd;
    z-index: 0;
}

.wizard-progress .step-indicator {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    cursor: default;
}

.wizard-progress .step-indicator .step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    counter-increment: step;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
}

.wizard-progress .step-indicator .step-label {
    display: none;
    font-size: 11px;
    color: #999;
    margin-top: 6px;
    text-align: center;
    white-space: nowrap;
}

.wizard-progress .step-indicator.active .step-number {
    background: var(--button-bg, #0069d9);
    color: #fff;
    border-color: var(--button-bg, #0069d9);
}

.wizard-progress .step-indicator.active .step-label {
    color: var(--button-bg, #0069d9);
    font-weight: 600;
}

.wizard-progress .step-indicator.completed .step-number {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.wizard-progress .step-indicator.completed .step-label {
    color: #28a745;
}

/* ---------- Wizard Steps ---------- */
.wizard-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wizard-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Navigation Buttons ---------- */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0 0.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid #eee;
    gap: 0.75rem;
}

.wizard-nav .btn-prev {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.wizard-nav .btn-prev:hover {
    background: #e8e8e8;
}

.wizard-nav .btn-next,
.wizard-nav .btn-submit {
    background: var(--button-bg, #0069d9);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.wizard-nav .btn-next:hover,
.wizard-nav .btn-submit:hover {
    background: var(--button-bg-hover, #0056b3);
    opacity: 0.9;
}

.wizard-nav .btn-next:disabled,
.wizard-nav .btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- Item Cards (Tickets / Workshops) ---------- */
.item-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.item-card:hover {
    border-color: #bbb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.item-card.selected {
    border-color: var(--button-bg, #0069d9);
    background: rgba(0, 105, 217, 0.03);
}

.item-card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.item-card.dep-required.selected {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.04);
}

.item-card.dep-required.selected .item-check {
    border-color: #28a745;
    background: #28a745;
}

/* "Requires: X" label shown on source cards (always visible) */
.dep-requires-note {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #0069d9;
    font-style: italic;
}

/* "Required by: X" label shown on locked required items */
.dep-required-note {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #28a745;
    font-weight: 600;
}

.item-card .item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding-right: 2.5rem; /* room for absolute-positioned .item-check */
}

.item-card .item-name {
    font-weight: 600;
    font-size: 15px;
    color: #222;
    flex: 1;
}

.item-card .item-price {
    font-weight: 700;
    font-size: 15px;
    color: var(--button-bg, #0069d9);
    white-space: nowrap;
}

.item-card .item-description {
    font-size: 13px;
    color: #666;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.item-card .item-meta {
    font-size: 12px;
    color: #999;
    margin-top: 0.5rem;
}

.item-card .item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.item-card .item-quantity label {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.item-card .item-quantity input[type="number"] {
    width: 60px;
    text-align: center;
    padding: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    margin: 0;
}

.item-card .item-check {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.item-card.selected .item-check {
    border-color: var(--button-bg, #0069d9);
    background: var(--button-bg, #0069d9);
    color: #fff;
}

.item-card.selected .item-check::after {
    content: '\2713';
    font-size: 13px;
    color: #fff;
}

/* ---------- Group Headers ---------- */
.item-group {
    margin-bottom: 1.5rem;
}

.item-group-header {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #eee;
}

.item-group-rule {
    font-size: 12px;
    color: #888;
    font-weight: 400;
    margin-left: 0.5rem;
}

/* ---------- Cart Summary ---------- */
.cart-summary {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.cart-summary-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.cart-line {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 14px;
}

.cart-line.cart-total {
    font-weight: 700;
    font-size: 16px;
    border-top: 2px solid #333;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.cart-line .cart-line-name {
    flex: 1;
}

.cart-line .cart-line-qty {
    color: #888;
    margin-right: 1rem;
}

.cart-line .cart-line-price {
    text-align: right;
    min-width: 80px;
}

.cart-line.discount {
    color: #28a745;
}

/* ---------- Coupon Input ---------- */
.coupon-form {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.coupon-form input {
    flex: 1;
    margin: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.coupon-form button {
    padding: 0.5rem 1rem;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.coupon-form button:hover {
    background: #545b62;
}

.coupon-message {
    font-size: 13px;
    margin-top: 0.25rem;
}

.coupon-message.success {
    color: #28a745;
}

.coupon-message.error {
    color: #dc3545;
}

/* ---------- Personal Data Form ---------- */
.wizard-form .form-row {
    margin-bottom: 1rem;
}

.wizard-form label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
    display: block;
}

.wizard-form label .required {
    color: #dc3545;
}

.wizard-form input[type="text"],
.wizard-form input[type="email"],
.wizard-form input[type="password"],
.wizard-form input[type="tel"],
.wizard-form select,
.wizard-form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    margin-bottom: 0;
}

.wizard-form input:focus,
.wizard-form select:focus {
    border-color: var(--button-bg, #0069d9);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 105, 217, 0.15);
}

.wizard-form .field-error {
    font-size: 12px;
    color: #dc3545;
    margin-top: 0.25rem;
}

.wizard-form .help-text {
    font-size: 12px;
    color: #888;
    margin-top: 0.25rem;
}

/* ---------- Account Section ---------- */
.account-section {
    background: #f0f7ff;
    border: 1px solid #cce0ff;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.account-section h3 {
    font-size: 16px;
    margin-bottom: 0.75rem;
}

.account-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.account-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.account-toggle label {
    font-size: 14px;
    cursor: pointer;
    margin: 0;
}

.account-fields {
    display: none;
}

.account-fields.visible {
    display: block;
}

/* ---------- AGB/Terms ---------- */
.terms-section {
    margin: 1rem 0;
    padding: 1rem;
    background: #fafafa;
    border-radius: 8px;
}

.terms-section label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 14px;
    cursor: pointer;
}

.terms-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ---------- Payment Section ---------- */
.payment-section {
    text-align: center;
    padding: 2rem 0;
}

.payment-section .free-order {
    font-size: 18px;
    color: #28a745;
    font-weight: 600;
}

#paypal-button-container {
    max-width: 400px;
    margin: 1rem auto;
}

/* ---------- Success Section ---------- */
.checkout-success {
    text-align: center;
    padding: 2rem 0;
}

.checkout-success .success-icon {
    font-size: 60px;
    color: #28a745;
    margin-bottom: 1rem;
}

.checkout-success h2 {
    color: #28a745;
    margin-bottom: 0.5rem;
}

.checkout-success .order-number {
    font-size: 18px;
    color: #555;
    margin-bottom: 1.5rem;
}

.checkout-success .action-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
}

.checkout-success .action-links a {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
}

/* ---------- Cart Badge ---------- */
.cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--button-bg, #0069d9);
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

.cart-badge:empty,
.cart-badge[data-count="0"] {
    display: none;
}

/* ---------- Loading Spinner ---------- */
.wizard-loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.wizard-loading.active {
    display: block;
}

.wizard-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--button-bg, #0069d9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- VC Modal (replaces browser alert) ---------- */
.vc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: vcFadeIn 0.15s ease;
}

.vc-modal-overlay.hiding {
    animation: vcFadeOut 0.15s ease forwards;
}

@keyframes vcFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes vcFadeOut { from { opacity: 1; } to { opacity: 0; } }

.vc-modal {
    background: #fff;
    border-radius: 8px;
    padding: 2rem 2rem 1.5rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    position: relative;
    text-align: center;
    animation: vcSlideIn 0.2s ease;
}

@keyframes vcSlideIn {
    from { transform: translateY(-16px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.vc-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 22px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.vc-modal-close:hover { color: #333; }

.vc-modal-icon {
    font-size: 44px;
    margin-bottom: 0.6rem;
    line-height: 1;
}

.vc-modal--error   .vc-modal-icon { color: #dc3545; }
.vc-modal--warning .vc-modal-icon { color: #e6a817; }
.vc-modal--info    .vc-modal-icon { color: var(--button-bg, #0069d9); }
.vc-modal--success .vc-modal-icon { color: #28a745; }

.vc-modal-title {
    font-size: 17px;
    font-weight: 600;
    color: #222;
    margin-bottom: 0.5rem;
}

.vc-modal-message {
    font-size: 14px;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.vc-modal-btn {
    background: var(--button-bg, #0069d9);
    color: var(--button-text, #fff);
    border: none;
    padding: 0.65rem 2.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}
.vc-modal-btn:hover { background: var(--button-bg-hover, #0056b3); }

/* ---------- Group Card Selection ---------- */
.group-selection {
    margin-bottom: 1.5rem;
}
.group-selection-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color, #333);
}
.group-card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.group-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    min-width: 140px;
    user-select: none;
}
.group-card:hover {
    border-color: var(--primary-color, #0070f3);
    box-shadow: 0 2px 8px rgba(0,112,243,0.1);
}
.group-card.selected {
    border-color: var(--primary-color, #0070f3);
    background: var(--primary-light, #eef5ff);
}
.group-card .item-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.group-card.selected .item-check {
    border-color: var(--primary-color, #0070f3);
    background: var(--primary-color, #0070f3);
}
.group-card.selected .item-check::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}
.group-card-name {
    font-weight: 500;
    color: var(--text-color, #333);
    font-size: 0.95rem;
}
@media (max-width: 480px) {
    .group-card { min-width: 100%; }
    .group-card-grid { gap: 0.5rem; }
}

/* ---------- Column Layout (form fields side-by-side) ---------- */
.form-col-row {
    display: grid;
    gap: 0 1rem;
    margin-bottom: 0;
}
.form-col-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-col-row.cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 639px) {
    .form-col-row.cols-2,
    .form-col-row.cols-3 { grid-template-columns: 1fr; }
}

/* ---------- International Phone Input ---------- */
.phone-intl-wrapper { display: block; }
.phone-intl-wrapper .iti { width: 100%; }
.phone-intl-wrapper .iti__tel-input { width: 100%; }
.phone-intl-wrapper .phone-intl-input { width: 100%; }

/* ---------- Inline field feedback ---------- */
.field-valid {
    font-size: 12px;
    color: #28a745;
    margin-top: 0.25rem;
}

/* ---------- Alerts ---------- */
.wizard-alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 14px;
}

.wizard-alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wizard-alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wizard-alert.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ---------- Responsive / Desktop ---------- */
@media (min-width: 640px) {
    .wizard-progress .step-indicator .step-label {
        display: block;
    }

    .wizard-nav {
        padding: 1.5rem 0 0.5rem;
    }

    .item-card {
        padding: 1.25rem;
    }

    .checkout-success .action-links {
        flex-direction: row;
        justify-content: center;
    }
}

@media (min-width: 1024px) {
    .wizard-progress .step-indicator .step-number {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .wizard-progress .step-indicator .step-label {
        font-size: 12px;
    }

    .item-card .item-name {
        font-size: 16px;
    }
}

/* ==========================================================================
   Auth Pages (Login, Register, Forgot Password, Reset Password)
   ========================================================================== */

/* Auth page centering */
.auth-page .whitebg {
    padding: 2rem 0 3rem;
    min-height: 60vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.auth-page .whitebg > .grid-container,
.auth-page .whitebg > div,
.auth-page .whitebg > form {
    width: 100%;
    max-width: 480px;
    padding: 0 1rem;
}

.auth-page h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 22px;
    color: #333;
}

.auth-page form {
    margin-bottom: 1rem;
}

.auth-page form label {
    font-size: 14px;
    color: #555;
    margin-bottom: 0.5rem;
}

.auth-page form input[type="text"],
.auth-page form input[type="email"],
.auth-page form input[type="password"] {
    padding: 0.65rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-page form input:focus {
    border-color: var(--button-bg, #0069d9);
    box-shadow: 0 0 0 2px rgba(0, 105, 217, 0.12);
    outline: none;
}

.auth-page .button.expanded {
    padding: 0.75rem;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    background: var(--button-bg, #0069d9);
    color: var(--button-text, #fff);
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.auth-page .button.expanded:hover {
    background: var(--button-bg-hover, #0056b3);
}

.auth-page .button.secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.auth-page .button.secondary:hover {
    background: #e0e0e0;
}

.auth-page .text-center {
    font-size: 14px;
    color: #666;
}

.auth-page .text-center a {
    color: var(--button-bg, #0069d9);
}

.auth-page .callout {
    border-radius: 6px;
    font-size: 14px;
}

.auth-page .help-text {
    font-size: 12px;
    color: #888;
}

/* ==========================================================================
   User Login Bar (shown on wizard pages)
   ========================================================================== */
.user-login-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 13px;
    color: #666;
}

.user-login-bar a {
    color: var(--button-bg, #0069d9);
    text-decoration: none;
    font-weight: 500;
}

.user-login-bar a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Coupon Form Refinement
   ========================================================================== */
.coupon-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    margin: 1rem 0;
}

.coupon-form input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.coupon-form button {
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

/* ==========================================================================
   Quantity Input Refinement
   ========================================================================== */
.item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.item-quantity label {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.item-quantity input[type="number"] {
    width: 60px;
    padding: 0.3rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

/* ==========================================================================
   Smooth Transitions
   ========================================================================== */
.wizard-step {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .wizard-progress,
    .wizard-nav,
    .user-login-bar,
    .payment-section {
        display: none !important;
    }

    .checkout-success {
        padding: 0;
    }
}
