/**
 * Ocean Reef — Member Flow shared layer
 * One design language for the three previously-disconnected member surfaces:
 * the create-event modal, /create-event, and /user-events.
 *
 * Tokens are derived ONLY from the existing brand palette:
 *   navy #08304E (primary) · deep navy #062238 (hover) · green #61BA9D (brand
 *   accent: focus/success/progress) · slate grays · existing status colors.
 * Signature: the "reef thread" — a 3px navy→green hairline that ties every
 * card/section header in the flow together.
 *
 * Load order note: both page templates print their own inline <style> AFTER
 * wp_head(), so page-local rules intentionally win over this file at equal
 * specificity. This file owns the SHARED pieces: the dashboard header (which
 * previously had no styles at all on /create-event), the modal components,
 * the thread, and the focus language.
 */

:root {
    --orc-navy: #08304E;
    --orc-navy-deep: #062238;
    --orc-navy-soft: #0a4269;
    --orc-green: #61BA9D;
    --orc-green-soft: rgba(97, 186, 157, 0.35);
    --orc-bg: #f8fafc;
    --orc-surface: #ffffff;
    --orc-border: #e2e8f0;
    --orc-border-strong: #cbd5e1;
    --orc-text: #1e293b;
    --orc-text-muted: #64748b;
    --orc-danger: #dc2626;
    --orc-danger-bg: #fef2f2;
    --orc-radius-ctl: 12px;
    --orc-radius-card: 16px;
    --orc-shadow-ctl: 0 1px 2px rgba(8, 48, 78, 0.06);
    --orc-shadow-card: 0 10px 30px rgba(8, 48, 78, 0.12);
    --orc-focus-ring: 0 0 0 3px var(--orc-green-soft);
    --orc-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ------------------------------------------------------------------ */
/* Signature: the reef thread                                          */
/* ------------------------------------------------------------------ */
.orc-thread {
    position: relative;
}

.orc-thread::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--orc-navy) 0%, var(--orc-green) 100%);
    border-radius: 3px 3px 0 0;
    pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Shared dashboard header (template-parts/wa-dashboard-header.php)    */
/* Previously styled only inside page-user-events.php's inline CSS —   */
/* on /create-event it rendered completely unstyled.                   */
/* ------------------------------------------------------------------ */
.dashboard-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    min-height: 88px;
    /* identical bar on /create-event and /user-events */
    padding: 12px 40px;
    background: linear-gradient(135deg, var(--orc-navy) 0%, var(--orc-navy-deep) 100%);
    color: #fff;
}

.dashboard-header::after {
    /* reef thread along the header's bottom edge */
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--orc-navy-soft) 0%, var(--orc-green) 100%);
    pointer-events: none;
}

.dashboard-header .logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.dashboard-header .logo-area img {
    max-height: 44px;
    width: auto;
}

.dashboard-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--orc-radius-ctl);
    font: 600 14px/1 var(--orc-font);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}

.dashboard-header .btn:active {
    transform: scale(0.98);
}

.dashboard-header .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.dashboard-header .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
}

.dashboard-header .user-area {
    display: flex;
    align-items: center;
}

.dashboard-header .user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.dashboard-header .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--orc-green);
    color: var(--orc-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 15px/1 var(--orc-font);
    flex-shrink: 0;
}

.dashboard-header .user-info .label {
    font: 500 11px/1.2 var(--orc-font);
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.dashboard-header .user-info .email {
    font: 600 13px/1.3 var(--orc-font);
    color: #fff;
    word-break: break-all;
}

.dashboard-header .logout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.dashboard-header .logout-icon:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fff;
}

@media (max-width: 640px) {
    .dashboard-header {
        padding: 14px 16px;
    }

    .dashboard-header .back-text {
        display: none;
    }

    .dashboard-header .user-info .email {
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        word-break: normal;
    }
}

/* ------------------------------------------------------------------ */
/* Create-event modal components (used by create-event-modal.js)       */
/* Structural Tailwind utilities stay in the JS; the visual language   */
/* lives here so the purged Tailwind build is never a constraint.      */
/* ------------------------------------------------------------------ */
.orc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    background: var(--orc-navy);
    color: #fff;
    border: none;
    border-radius: var(--orc-radius-ctl);
    font: 700 15px/1.2 var(--orc-font);
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: var(--orc-shadow-ctl);
    transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease;
}

.orc-btn:hover {
    background: var(--orc-navy-deep);
    box-shadow: 0 4px 14px rgba(8, 48, 78, 0.25);
}

.orc-btn:active {
    transform: scale(0.985);
}

.orc-btn:focus-visible {
    outline: none;
    box-shadow: var(--orc-focus-ring);
}

.orc-btn:disabled {
    opacity: .65;
    cursor: default;
    transform: none;
}

.orc-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: var(--orc-surface);
    color: var(--orc-navy);
    border: 1.5px solid var(--orc-border);
    border-radius: var(--orc-radius-ctl);
    font: 600 14px/1.2 var(--orc-font);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, transform .1s ease;
}

.orc-btn-ghost:hover {
    border-color: var(--orc-border-strong);
    background: var(--orc-bg);
}

.orc-btn-ghost:active {
    transform: scale(0.985);
}

.orc-btn-ghost:focus-visible {
    outline: none;
    box-shadow: var(--orc-focus-ring);
}

.orc-label {
    display: block;
    margin-bottom: 6px;
    font: 600 13px/1.3 var(--orc-font);
    color: #334155;
}

.orc-input {
    display: block;
    width: 100%;
    padding: 12px 14px;
    background: var(--orc-surface);
    border: 1px solid var(--orc-border);
    border-radius: var(--orc-radius-ctl);
    font: 400 15px/1.4 var(--orc-font);
    color: var(--orc-text);
    box-shadow: var(--orc-shadow-ctl);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.orc-input::placeholder {
    color: #94a3b8;
}

.orc-input:focus {
    outline: none;
    border-color: var(--orc-navy);
    box-shadow: var(--orc-focus-ring);
}

.orc-error.hidden {
    /* Tailwind's .hidden must keep winning (this file loads after the compiled
       Tailwind bundle, so without this guard the error box would never hide). */
    display: none;
}

.orc-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--orc-danger-bg);
    border: 1px solid #fecaca;
    border-radius: var(--orc-radius-ctl);
    color: #b91c1c;
    font: 500 14px/1.45 var(--orc-font);
}

.orc-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--orc-bg);
    border: 1px solid var(--orc-border);
    border-radius: 999px;
    font: 600 13px/1.2 var(--orc-font);
    color: #475569;
}

.orc-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--orc-navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 28px/1 var(--orc-font);
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--orc-green-soft);
}

.orc-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    font: 500 12px/1 var(--orc-font);
    letter-spacing: .08em;
    text-transform: uppercase;
}

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

/* Success state check — brand green family instead of generic Tailwind green */
.orc-success-badge {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(97, 186, 157, 0.15);
    color: #2f9578;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ------------------------------------------------------------------ */
/* Motion discipline                                                   */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {

    .orc-btn,
    .orc-btn-ghost,
    .orc-input,
    .dashboard-header .btn,
    .dashboard-header .logout-icon {
        transition: none;
    }
}
