* { margin: 0; padding: 0; box-sizing: border-box; }

/* display 指定のあるクラス（.modal 等）でも hidden 属性を必ず優先させる */
[hidden] { display: none !important; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
    background: #f4f4f5;
    color: #27272a;
    min-height: 100vh;
}

.center-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    line-height: 1.8;
    color: #52525b;
}

main {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 40px;
}

/* ---- プロフィール ---- */
.profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px 16px;
}
.profile img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}
.name { font-size: 18px; font-weight: 700; }

.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #b8860b, #ffd700);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.vip-expiry { font-weight: 400; opacity: 0.9; }

.consent-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* ---- 同意カード / フォーム ---- */
.consent-card { border: 1.5px solid #bfdbfe; }
.consent-lead { font-size: 13px; color: #52525b; line-height: 1.7; margin-bottom: 14px; }

.consent-title {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid #e4e4e7;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.6;
    cursor: pointer;
}
.check-row input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }
.check-row:has(input:checked) { border-color: #2563eb; background: #eff6ff; }

.field { margin-top: 12px; }
.field label { display: block; font-size: 12px; color: #52525b; margin-bottom: 5px; font-weight: 700; }
.field input {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #d4d4d8;
    border-radius: 10px;
    font-size: 16px;
}
.consent-error { color: #b91c1c; font-size: 13px; text-align: center; margin-top: 12px; }
#submit-consent { margin-top: 16px; }
#submit-consent:disabled { opacity: 0.4; cursor: not-allowed; }
#close-consent { margin-top: 10px; }

/* ---- カード ---- */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.card h2 {
    font-size: 15px;
    color: #52525b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- スタンプ ---- */
.stamp-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}
.stamp-cell {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px dashed #d4d4d8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #d4d4d8;
}
.stamp-cell.filled {
    border: 2px solid #27272a;
    background: #27272a;
    color: #fff;
}
.stamp-note {
    font-size: 12px;
    color: #a1a1aa;
    text-align: center;
    margin-bottom: 16px;
}

/* ---- クーポン ---- */
.coupon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1.5px solid #27272a;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.coupon.inactive {
    border-color: #e4e4e7;
    color: #a1a1aa;
}
.coupon-amount { font-size: 20px; font-weight: 700; }
.coupon-meta { font-size: 12px; text-align: right; line-height: 1.6; }
.coupon-status {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.coupon-status.active { background: #27272a; color: #fff; }
.coupon-status.used { background: #e4e4e7; color: #71717a; }
.coupon-status.expired { background: #fee2e2; color: #b91c1c; }
.no-coupon {
    text-align: center;
    color: #a1a1aa;
    font-size: 13px;
    padding: 12px 0;
}

/* ---- ボタン ---- */
.btn-primary, .btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.btn-primary { background: #27272a; color: #fff; }
.btn-primary:active { opacity: 0.85; }
.btn-secondary { background: #e4e4e7; color: #27272a; margin-top: 16px; }

/* ---- QR モーダル ---- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}
.modal-body {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}
.qr-title { font-weight: 700; margin-bottom: 16px; }
#qr-img { width: 100%; max-width: 280px; }
.qr-note { font-size: 12px; color: #a1a1aa; margin-top: 12px; }

/* ---- トースト通知 ---- */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: #27272a;
    color: #fff;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    animation: toast-in 0.3s ease;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
