/* ==========================================
   tickets.j-sub.net — Design System CSS
   Based on UI_DESIGN_GUIDE.md
   Stripe風 × Apple風 × Peatix UX
   ========================================== */

/* --- CSS Custom Properties --- */
:root {
    --bg: #f7f1e8;
    --bg-end: #fbfaf8;
    --text: #182126;
    --muted: #5d6a73;
    --line: rgba(24, 33, 38, 0.10);
    --primary: #c44d2d;
    --primary-dark: #9d371c;
    --accent: #5469d4;
    --success: #2d9e5a;
    --warning: #e88c30;
    --danger: #d32f2f;
    --card-bg: rgba(255, 255, 255, 0.92);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --font: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    line-height: 1.7;
    background:
        radial-gradient(circle at top left, rgba(196, 77, 45, 0.12), transparent 40%),
        radial-gradient(circle at bottom right, rgba(84, 105, 212, 0.06), transparent 40%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-end) 100%);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* --- Focus (Accessibility) --- */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Layout --- */
.page {
    width: min(100%, 960px);
    margin: 0 auto;
    padding: 0 16px 120px;
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 12px 16px;
    background: rgba(247, 241, 232, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.02em;
}
.site-logo:hover { text-decoration: none; color: var(--primary); }

.site-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.site-nav a {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* --- Footer --- */
.site-footer {
    padding: 32px 16px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.footer-payment-guide {
    margin: 0 auto 14px;
    max-width: 520px;
    text-align: center;
}

.footer-payment-title {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--muted);
}

/* --- Hero --- */
.hero {
    padding: 40px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0.90));
    box-shadow: var(--shadow);
    margin-top: 24px;
    text-align: center;
}

.hero-eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.hero-lead {
    margin: 16px auto 0;
    max-width: 520px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
}

/* --- Event Image Hero --- */
.event-hero-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.event-hero-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #f0e6d8 0%, #e8d6c4 50%, #d4bfa8 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-hero-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.25;
}

.event-hero-content {
    padding: 24px;
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.95));
    box-shadow: var(--shadow);
}

/* --- Section --- */
.section {
    margin-top: 32px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin: -8px 0 16px;
}

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: box-shadow 0.2s;
}

@media (hover: hover) {
    .card-interactive:hover {
        box-shadow: var(--shadow-lg);
    }
}

.card-interactive {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.card-interactive:hover { text-decoration: none; }

.card-grid {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.card h2, .card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

/* --- Event Card (List) --- */
.event-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    background: linear-gradient(135deg, #f0e6d8, #d4bfa8);
}

.event-card-image-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    background: linear-gradient(135deg, #f0e6d8 0%, #e8d6c4 50%, #d4bfa8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-card-image-placeholder svg {
    width: 40px;
    height: 40px;
    opacity: 0.2;
}

.event-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.event-card-meta svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.event-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text);
}

.event-card-price {
    font-size: 14px;
    color: var(--muted);
}

.event-card-price strong {
    color: var(--text);
    font-weight: 800;
    font-size: 18px;
}

.event-card-ended {
    opacity: 0.55;
    filter: grayscale(0.3);
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.badge-available { background: #e8f5e9; color: var(--success); }
.badge-few      { background: #fff3e0; color: var(--warning); }
.badge-soldout  { background: #fceaea; color: var(--danger); }
.badge-ended    { background: #f0f0f0; color: var(--muted); }
.badge-online   { background: #e8eaf6; color: var(--accent); }
.badge-offline  { background: #fce4ec; color: #ad1457; }

/* --- Schedule Card --- */
.schedule-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.schedule-date {
    font-size: 15px;
    font-weight: 700;
}

.schedule-venue {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--muted);
}

.schedule-venue svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* --- Ticket/Offering Card --- */
.offering-card {
    position: relative;
    overflow: hidden;
}

.offering-card-highlight {
    border-color: var(--primary);
    border-width: 2px;
}

.offering-card-highlight::before {
    content: "おすすめ";
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 0 0 0 var(--radius-sm);
}

.offering-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
}

.offering-description {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 12px;
    line-height: 1.7;
}

.offering-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 4px;
}

.offering-price-note {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

.offering-features {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.offering-features li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 3px 0;
    color: var(--muted);
}

.offering-features li svg {
    width: 16px;
    height: 16px;
    color: var(--success);
    flex-shrink: 0;
}

.purchase-group-list {
    display: grid;
    gap: 20px;
}

.purchase-group-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.purchase-group-card-highlight {
    border-color: rgba(84, 105, 212, 0.28);
    background: linear-gradient(180deg, rgba(84, 105, 212, 0.06), rgba(255, 255, 255, 0.96));
}

.purchase-group-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.purchase-group-label {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
    text-transform: uppercase;
}

.purchase-group-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.purchase-group-copy {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--muted);
}

.group-method-list {
    display: grid;
    gap: 12px;
}

.group-method-list-single {
    max-width: 420px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 24px;
    border: none;
    border-radius: 12px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(196, 77, 45, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(196, 77, 45, 0.35);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid rgba(24, 33, 38, 0.15);
}

.btn-secondary:hover {
    background: #f8f8f8;
    color: var(--text);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(84, 105, 212, 0.25);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-full {
    width: 100%;
}

.btn-lg {
    min-height: 52px;
    border-radius: 14px;
    font-size: 16px;
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* --- Action row --- */
.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

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

/* --- Form --- */
.form-group {
    margin-bottom: 20px;
}

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

.form-label-required::after {
    content: " *";
    color: var(--danger);
}

.form-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    font-family: var(--font);
    font-size: 16px;
    border: 1.5px solid rgba(24, 33, 38, 0.2);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
    color: #b0b8bf;
}

.form-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(84, 105, 212, 0.15);
}

.form-hint {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

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

/* --- Summary Card --- */
.summary-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.90));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    font-size: 14px;
}

.summary-label {
    color: var(--muted);
}

.summary-value {
    font-weight: 600;
    text-align: right;
}

.summary-divider {
    border: none;
    border-top: 1px solid var(--line);
    margin: 10px 0;
}

.summary-total {
    font-size: 20px;
    font-weight: 800;
}

/* --- Policy Box --- */
.policy-box {
    background: #fefaf5;
    border: 1px solid rgba(232, 140, 48, 0.2);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
}

.policy-box-title {
    font-weight: 700;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 14px;
}

.policy-box-title svg {
    width: 16px;
    height: 16px;
}

.payment-method-box {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(84, 105, 212, 0.04);
}

.payment-method-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.payment-method-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
}

.payment-brand-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.payment-brand-list-compact {
    gap: 6px;
}

.payment-brand-list-footer {
    gap: 14px;
    margin-top: 10px;
}

.payment-brand-list-checkout {
    gap: 14px;
    margin-top: 8px;
}

.payment-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 8px 12px;
    border: 1px solid rgba(24, 33, 38, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.payment-brand-logo {
    min-width: auto;
    min-height: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.payment-brand-logo img {
    display: block;
    width: auto;
    max-width: none;
    height: 20px;
    object-fit: contain;
    margin: 0;
    background: transparent;
}

.payment-brand-list-checkout .payment-brand-logo img {
    height: 22px;
}

.payment-brand-list-footer .payment-brand-logo img {
    height: 20px;
}

/* --- Info List --- */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--line);
}

.info-list li:last-child { border-bottom: none; }

.info-list li svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--muted);
}

.info-list .info-label {
    color: var(--muted);
    min-width: 80px;
    flex-shrink: 0;
}

/* --- Success Page --- */
.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.success-heading {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 8px;
}

.success-sub {
    text-align: center;
    font-size: 15px;
    color: var(--muted);
    margin: 0 0 28px;
}

.ticket-number {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}

.ticket-number strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* --- Notice Box --- */
.notice-box {
    background: rgba(84, 105, 212, 0.06);
    border: 1px solid rgba(84, 105, 212, 0.15);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
}

.notice-box-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
    font-size: 14px;
}

.notice-box-icon svg {
    width: 16px;
    height: 16px;
}

/* --- Breadcrumb --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    padding: 16px 0 4px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--muted);
}
.breadcrumb a:hover { color: var(--text); }

.breadcrumb-sep {
    color: #ccc;
}

/* --- Fixed CTA Bar (Mobile) --- */
.fixed-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fixed-cta-price {
    font-size: 20px;
    font-weight: 800;
    white-space: nowrap;
}

.fixed-cta-price small {
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.fixed-cta-bar .btn {
    flex: 1;
    max-width: 260px;
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}

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

/* --- Event Ended Banner --- */
.ended-banner {
    background: #f0f0f0;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-sm     { font-size: 13px; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }

/* ==========================================
   Responsive
   ========================================== */
@media (min-width: 720px) {
    body { font-size: 16px; }

    .page {
        padding: 0 24px 80px;
    }

    .hero {
        padding: 56px 40px;
        margin-top: 32px;
    }

    .hero h1 {
        font-size: 40px;
    }

    .section-title {
        font-size: 24px;
    }

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

    .card-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .offering-price {
        font-size: 28px;
    }

    .event-hero-content {
        padding: 36px;
    }

    /* Hide fixed CTA on desktop */
    .fixed-cta-bar {
        display: none;
    }
}

@media (min-width: 1024px) {
    .card-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}
