/**
 * InEvently — Embed Form CSS
 * Loaded by e/embed.php (guest-facing iframe). Standalone — no Metronic.
 * Loaded alongside local Bootstrap 5 for utilities and base components.
 * Defines Metronic-compatible class names needed by embed.php + visual polish.
 *
 * CSS custom properties set by embed.php from event/org colors:
 *   --ie-primary   (button, focus, accent)
 *   --ie-secondary
 */

/* -------------------------------------------------------------------------
   Base
------------------------------------------------------------------------- */
:root {
    --ie-primary:   #1B84FF;
    --ie-secondary: #071437;
    --ie-radius:    8px;
    --ie-shadow:    0 1px 4px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 16px 16px 48px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1e1e2d;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------------------
   Card
------------------------------------------------------------------------- */
.card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: var(--ie-radius);
    box-shadow: var(--ie-shadow);
    margin-bottom: 0;
}

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: transparent;
    border-radius: var(--ie-radius) var(--ie-radius) 0 0;
    display: flex;
    align-items: center;
}

.card-header strong {
    font-size: 14px;
    font-weight: 600;
    color: #1e1e2d;
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    background: transparent;
    border-radius: 0 0 var(--ie-radius) var(--ie-radius);
}

/* -------------------------------------------------------------------------
   Form Controls
   Bootstrap provides .form-control base; we add .form-control-solid
------------------------------------------------------------------------- */
.form-control-solid,
.form-select-solid {
    background-color: #f5f8fa;
    border-color: #f5f8fa;
    color: #1e1e2d;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.form-control-solid:focus,
.form-select-solid:focus {
    background-color: #fff;
    border-color: var(--ie-primary);
    box-shadow: 0 0 0 3px rgba(27, 132, 255, 0.15);
    outline: none;
}

.form-control-solid::placeholder {
    color: #b5b5c3;
}

.form-control-sm {
    padding: 0.35rem 0.75rem;
    font-size: 13px;
    border-radius: 6px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: #5e6278;
    margin-bottom: 4px;
    display: block;
}

.form-label.required::after {
    content: ' *';
    color: #f1416c;
}

/* -------------------------------------------------------------------------
   Buttons
------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--ie-primary);
    border-color: var(--ie-primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.88;
    color: #fff;
}

.btn-light {
    background-color: #f5f8fa;
    border-color: #f5f8fa;
    color: #5e6278;
}

.btn-light:hover:not(:disabled) {
    background-color: #e4e6ef;
    border-color: #e4e6ef;
    color: #1e1e2d;
}

.btn-light-danger {
    background-color: #fff5f8;
    border-color: #fff5f8;
    color: #f1416c;
}

.btn-light-danger:hover:not(:disabled) {
    background-color: #f1416c;
    border-color: #f1416c;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
}

.btn-icon.btn-sm {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.w-100 { width: 100%; }

/* -------------------------------------------------------------------------
   Badges
------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    line-height: 1.4;
}

.badge-light-danger {
    background: #fff5f8;
    color: #f1416c;
}

.badge-light-warning {
    background: #fff8dd;
    color: #f6c000;
}

.badge-light-success {
    background: #e8fff3;
    color: #50cd89;
}

/* -------------------------------------------------------------------------
   Checkboxes & Radios
   .form-check-custom / .form-check-solid are Metronic class names
------------------------------------------------------------------------- */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.form-check-custom,
.form-check-solid {
    /* no additional styles needed beyond .form-check */
}

.form-check-input {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 2px 0 0;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    accent-color: var(--ie-primary);
    flex-shrink: 0;
}

.form-check-input:checked {
    background-color: var(--ie-primary);
    border-color: var(--ie-primary);
}

.form-check-label {
    font-size: 13px;
    color: #3f4254;
    cursor: pointer;
    line-height: 1.5;
}

/* -------------------------------------------------------------------------
   Alert
------------------------------------------------------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--ie-radius);
    font-size: 13px;
    margin-bottom: 12px;
    border: 1px solid transparent;
}

.alert-danger {
    background: #fff5f8;
    border-color: #fcd3de;
    color: #c0143c;
}

/* -------------------------------------------------------------------------
   Step Indicators
------------------------------------------------------------------------- */
#step-indicators {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.step-dot {
    padding: 3px 10px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #9e9e9e;
    font-size: 11px;
    font-weight: 600;
}

.step-dot.active {
    background: var(--ie-primary);
    color: #fff;
}

.step-dot.done {
    background: #e8fff3;
    color: #50cd89;
}

/* -------------------------------------------------------------------------
   Ticket rows
------------------------------------------------------------------------- */
.ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.ticket-row:last-child {
    border-bottom: none;
}

/* -------------------------------------------------------------------------
   Order summary lines
------------------------------------------------------------------------- */
#summary-lines .d-flex,
#final-summary .d-flex {
    margin-bottom: 4px;
}

/* -------------------------------------------------------------------------
   Spinner (Bootstrap-compatible)
------------------------------------------------------------------------- */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.spinner-border-sm {
    width: 0.8rem;
    height: 0.8rem;
    border-width: 0.12em;
}

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

/* -------------------------------------------------------------------------
   Event header (compact)
------------------------------------------------------------------------- */
.ie-event-header {
    margin-bottom: 14px;
}

.ie-event-header .ie-event-name {
    font-weight: 700;
    font-size: 16px;
    color: #1e1e2d;
}

.ie-event-header .ie-event-meta {
    color: #9e9e9e;
    font-size: 12px;
    margin-top: 2px;
}

/* -------------------------------------------------------------------------
   Stripe card element wrapper
------------------------------------------------------------------------- */
#stripe-card-element {
    padding: 10px 12px;
    background: #f5f8fa;
    border: 1px solid #f5f8fa;
    border-radius: 6px;
    transition: border-color 0.15s ease;
}

#stripe-card-element.StripeElement--focus {
    background: #fff;
    border-color: var(--ie-primary);
    box-shadow: 0 0 0 3px rgba(27, 132, 255, 0.15);
}

#stripe-card-error {
    color: #f1416c;
    font-size: 12px;
    margin-top: 6px;
}

/* -------------------------------------------------------------------------
   Mobile tweaks
------------------------------------------------------------------------- */
@media (max-width: 480px) {
    body {
        padding: 12px 12px 40px;
    }

    .btn {
        padding: 10px 14px;
    }

    .card-body {
        padding: 14px 12px;
    }

    .card-header {
        padding: 10px 12px;
    }

    .ticket-row {
        padding: 10px 12px;
    }
}
