/* ============================================================
   OnFire Share – share-gate.css
   Call-recording page (/r/<token>) and the password gate on shared
   notes (/n/<token>). Loaded after style.css; same palette, light only
   like the rest of share.onfire.so.
   ============================================================ */

:root {
    --sg-text: #222222;
    --sg-text-muted: #707781;   /* 4.5:1 on --sg-surface only */
    --sg-surface: #ffffff;
    --sg-surface-alt: #f5f5f7;
    --sg-border: #e5e5ea;
    --sg-brand: #FF6B1F;
    /* Fills that carry white text. Brand #FF6B1F is 2.9:1 against white,
       below WCAG AA; this deeper orange is 4.7:1. */
    --sg-accent: #C94A05;
    --sg-accent-hover: #B04004;
    --sg-accent-soft: #FFF1E8;
    --sg-danger: #C62D22;        /* 5.2:1 on white */
    --sg-skeleton: #ececf0;
    --sg-skeleton-shine: #f7f7f9;
    --sg-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
    --sg-ease: cubic-bezier(0.33, 1, 0.68, 1); /* easeOutCubic */
    --sg-radius-card: 16px;
}

.rec-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Card --------------------------------------------------- */
.rec-card {
    width: 100%;
    max-width: 880px;
    background: var(--sg-surface);
    border-radius: var(--sg-radius-card);
    box-shadow: var(--sg-shadow);
    overflow: hidden;
    color: var(--sg-text);
}

.rec-card.rec-card--narrow {
    max-width: 480px;
}

.rec-enter {
    animation: rec-enter 320ms var(--sg-ease) both;
}

@keyframes rec-enter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.rec-body {
    padding: 24px 32px 32px;
}

.rec-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sg-accent);
    margin-bottom: 8px;
}

.rec-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.4px;
    color: var(--sg-text);
    word-break: break-word;
    outline: none;
}

.rec-meta {
    margin-top: 8px;
    font-size: 14px;
    color: var(--sg-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.rec-meta-item {
    display: inline-flex;
    gap: 8px;
    white-space: nowrap;
}

.rec-meta-sep {
    color: var(--sg-text-muted);
}

/* --- Player -------------------------------------------------- */
.rec-media {
    background: #000000;
    aspect-ratio: 16 / 9;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rec-media video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000000;
}

.rec-media--audio {
    aspect-ratio: auto;
    padding: 32px 24px;
    background: linear-gradient(135deg, var(--sg-brand) 0%, #FFCE54 100%);
    flex-direction: column;
    gap: 16px;
}

.rec-media--audio svg {
    color: #ffffff;
    opacity: 0.95;
}

.rec-media--audio audio {
    width: 100%;
    max-width: 520px;
}

.rec-media-error {
    margin: 0;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--sg-text);
    background: var(--sg-accent-soft);
}

/* --- Buttons (pill) ------------------------------------------ */
.rec-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.rec-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 24px;
    border-radius: 9999px;
    border: 1.5px solid transparent;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 180ms var(--sg-ease), border-color 180ms var(--sg-ease),
                transform 150ms var(--sg-ease), opacity 180ms var(--sg-ease);
    -webkit-tap-highlight-color: transparent;
}

.rec-btn:active:not([disabled]):not([aria-disabled="true"]) {
    transform: scale(0.97);
}

.rec-btn:focus-visible,
.rec-transcript:focus-visible,
.rec-reveal:focus-visible,
.rec-input:focus-visible {
    outline: 3px solid var(--sg-accent);
    outline-offset: 2px;
}

.rec-btn--primary {
    background: var(--sg-accent);
    color: #ffffff;
}

.rec-btn--primary:hover:not([disabled]):not([aria-disabled="true"]) {
    background: var(--sg-accent-hover);
}

.rec-btn--secondary {
    background: var(--sg-surface);
    color: var(--sg-accent);
    border-color: var(--sg-accent);
}

.rec-btn--secondary:hover:not([disabled]):not([aria-disabled="true"]) {
    background: var(--sg-accent-soft);
}

.rec-btn[disabled],
.rec-btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
}

.rec-btn--block {
    width: 100%;
}

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

.rec-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    animation: rec-spin 800ms linear infinite; /* continuous loop: linear is fine */
}

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

/* --- Transcript link ----------------------------------------- */
.rec-transcript {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px;
    border: 1px solid var(--sg-border);
    border-radius: 12px;
    color: var(--sg-text);
    text-decoration: none;
    transition: background-color 180ms var(--sg-ease), border-color 180ms var(--sg-ease);
}

.rec-transcript:hover {
    background: var(--sg-surface-alt);
    border-color: #d1d1d6;
}

.rec-transcript-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--sg-accent-soft);
    color: var(--sg-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rec-transcript-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rec-transcript-title {
    font-size: 16px;
    font-weight: 600;
}

.rec-transcript-sub {
    font-size: 14px;
    color: var(--sg-text-muted);
}

.rec-transcript-chevron {
    flex: 0 0 auto;
    color: var(--sg-text-muted);
}

.rec-notice {
    margin-top: 24px;
    font-size: 13px;
    color: var(--sg-text-muted);
}

.rec-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--sg-border);
    text-align: center;
}

/* --- Status views (not found / expired / private / processing) -- */
.rec-status {
    padding: 48px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rec-status-icon,
.rec-gate-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--sg-accent-soft);
    color: var(--sg-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.rec-status-detail,
.rec-gate-sub {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--sg-text-muted);
    max-width: 400px;
}

.rec-status .rec-actions {
    justify-content: center;
}

/* --- Password gate ------------------------------------------- */
.rec-gate {
    padding: 40px 32px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.rec-form {
    width: 100%;
    max-width: 360px;
    margin-top: 24px;
    text-align: left;
}

.rec-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--sg-text);
    margin-bottom: 8px;
}

.rec-input-wrap {
    position: relative;
}

.rec-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 56px 12px 16px;
    font: inherit;
    font-size: 16px; /* ≥16px: no iOS zoom-on-focus */
    color: var(--sg-text);
    background: var(--sg-surface);
    border: 1.5px solid #c7c7cc;
    border-radius: 12px;
    transition: border-color 180ms var(--sg-ease), box-shadow 180ms var(--sg-ease);
}

.rec-input:focus {
    border-color: var(--sg-accent);
}

.rec-input[aria-invalid="true"] {
    border-color: var(--sg-danger);
}

.rec-input[readonly] {
    background: var(--sg-surface-alt);
}

.rec-reveal {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--sg-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.rec-gate-msg {
    min-height: 24px;
    margin: 8px 0 16px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--sg-danger);
}

.rec-gate-msg:empty {
    margin-bottom: 8px;
}

.rec-gate-msg.rec-gate-msg--info {
    color: var(--sg-text-muted);
}

.rec-shake {
    animation: rec-shake 320ms var(--sg-ease);
}

@keyframes rec-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* --- Skeleton ------------------------------------------------- */
.rec-skel {
    background: linear-gradient(90deg, var(--sg-skeleton) 0%, var(--sg-skeleton-shine) 50%, var(--sg-skeleton) 100%);
    background-size: 200% 100%;
    animation: rec-shimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
}

.rec-skel-media {
    aspect-ratio: 16 / 9;
    width: 100%;
    border-radius: 0;
}

.rec-skel-line {
    height: 14px;
    margin-bottom: 12px;
}

.rec-skel-short { width: 120px; }
.rec-skel-title { width: 70%; height: 28px; }
.rec-skel-meta  { width: 40%; }

@keyframes rec-shimmer {
    from { background-position: 100% 0; }
    to   { background-position: -100% 0; }
}

.rec-noscript {
    text-align: center;
    padding: 24px 16px;
    color: var(--sg-text-muted);
}

/* --- Note gate (inside #note-wrapper on /n/<token>) ----------- */
#note-gate {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* --- Responsive ----------------------------------------------- */
@media (max-width: 600px) {
    .rec-card {
        border-radius: 12px;
    }

    .rec-body {
        padding: 20px 16px 24px;
    }

    .rec-title {
        font-size: 22px;
    }

    .rec-actions .rec-btn {
        flex: 1 1 100%;
    }

    .rec-status,
    .rec-gate {
        padding: 40px 16px 24px;
    }

    .rec-footer {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rec-enter,
    .rec-shake,
    .rec-skel {
        animation: none;
    }

    .rec-btn,
    .rec-transcript,
    .rec-input {
        transition: none;
    }
}

@media print {
    .rec-actions,
    .rec-footer {
        display: none;
    }
}
