/* subscription/subscription.html */
body { background: #f4f6fb; }

        /* ── Hero ── */
        .sub-hero {
            background: #fff;
            padding: 52px 24px 44px;
            text-align: center;
            border-bottom: 1px solid #e8eaf0;
        }
        .sub-hero .tag {
            display: inline-block;
            border: 1.5px solid #2563eb;
            color: #2563eb;
            border-radius: 20px;
            padding: 4px 18px;
            font-size: 0.85rem;
            margin-bottom: 20px;
        }
        .sub-hero h2 {
            font-size: 2.2rem;
            font-weight: 800;
            margin: 0 0 10px;
            color: #111;
        }
        .sub-hero p {
            color: #6b7280;
            margin: 0;
            font-size: 1rem;
        }

        /* ── Plan section ── */
        .plan-section {
            max-width: 900px;
            margin: 0 auto;
            padding: 44px 24px 32px;
        }
        .sub-section-label {
            font-size: 0.9rem;
            color: #6b7280;
            margin-bottom: 20px;
            text-align: center;
        }
        .sub-billing-cycle { color: #2563eb; font-weight: 600; }

        /* ── Plan grid ── */
        .plan-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            margin-bottom: 0;
            align-items: start;
        }
        .plan-card { position: relative; }
        .plan-card input[type="radio"] { display: none; }

        /* Badge 最受歡迎 */
        .plan-popular-badge {
            position: absolute;
            top: -16px;
            left: 50%;
            transform: translateX(-50%);
            background: #2563eb;
            color: #fff;
            font-size: 0.78rem;
            font-weight: 700;
            padding: 4px 16px;
            border-radius: 20px;
            white-space: nowrap;
            z-index: 1;
        }

        .plan-card label {
            display: flex;
            flex-direction: column;
            border: 2px solid #e5e7eb;
            border-radius: 18px;
            padding: 28px 22px 22px;
            text-align: left;
            cursor: pointer;
            background: #fff;
            transition: border-color 0.2s, box-shadow 0.2s;
            height: 100%;
            box-sizing: border-box;
        }
        .plan-card label:hover {
            border-color: #93c5fd;
            box-shadow: 0 4px 16px rgba(37,99,235,0.08);
        }

        /* Selected */
        .plan-card input[type="radio"]:checked + label {
            border-color: #2563eb;
            box-shadow: 0 4px 20px rgba(37,99,235,0.15);
        }


        .plan-name {
            display: block;
            font-weight: 700;
            font-size: 1.15rem;
            color: #111;
            margin-bottom: 4px;
        }
        .plan-tagline {
            display: block;
            font-size: 0.82rem;
            color: #6b7280;
            margin-bottom: 18px;
        }
        .plan-price-wrap {
            margin-bottom: 6px;
        }
        .plan-price-currency {
            font-size: 0.9rem;
            font-weight: 600;
            color: #374151;
            vertical-align: top;
            line-height: 2.6;
        }
        .plan-price-amount {
            font-size: 2.6rem;
            font-weight: 800;
            color: #111;
            line-height: 1;
        }
        .plan-cycle {
            display: block;
            font-size: 0.82rem;
            color: #9ca3af;
            margin-bottom: 16px;
        }
        .plan-desc-badge {
            display: inline-block;
            background: #eff6ff;
            color: #2563eb;
            font-size: 0.82rem;
            font-weight: 600;
            padding: 6px 14px;
            border-radius: 8px;
            margin-bottom: 20px;
        }
        .plan-select-btn {
            display: block;
            width: 100%;
            padding: 12px;
            border: 1.5px solid #d1d5db;
            border-radius: 10px;
            background: #fff;
            font-size: 0.95rem;
            font-weight: 600;
            color: #374151;
            text-align: center;
            margin-top: auto;
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }
        .plan-card label:hover .plan-select-btn {
            border-color: #2563eb;
            color: #2563eb;
        }
        .plan-card input[type="radio"]:checked + label .plan-select-btn {
            background: #2563eb;
            border-color: #2563eb;
            color: #fff;
        }
        .plan-card input[type="radio"]:checked + label .plan-name { color: #2563eb; }
        .plan-card input[type="radio"]:checked + label .plan-price-amount { color: #2563eb; }
        .plan-card input[type="radio"]:checked + label .plan-cycle { color: #93c5fd; }

        /* ── Form section ── */
        .sub-form-section {
            max-width: 640px;
            margin: 0 auto;
            padding: 0 24px 48px;
        }
        .sub-divider { border: none; border-top: 1px solid #e5e7eb; margin: 36px 0; }
        .sub-section-label-form {
            font-size: 0.82rem;
            font-weight: 600;
            color: #6b7280;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 14px;
        }
        .sub-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 0; }
        .sub-field { margin-bottom: 16px; }
        .sub-field label { display: block; font-size: 0.9rem; font-weight: 500; color: #374151; margin-bottom: 6px; }
        .sub-field input {
            width: 100%;
            border: 1.5px solid #e5e7eb;
            border-radius: 10px;
            padding: 12px 14px;
            font-size: 0.95rem;
            outline: none;
            background: #fff;
            box-sizing: border-box;
            transition: border-color 0.2s;
        }
        .sub-field input:focus { border-color: #2563eb; }
        .sub-field input::placeholder { color: #d1d5db; }

        /* ── Privacy checkbox ── */
        .privacy-check-wrap {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin-bottom: 16px;
            font-size: 0.9rem;
            color: #374151;
        }
        .privacy-check-wrap input[type="checkbox"] {
            margin-top: 3px;
            width: 17px;
            height: 17px;
            flex-shrink: 0;
            cursor: pointer;
            accent-color: #2563eb;
        }
        .privacy-link {
            color: #2563eb;
            text-decoration: underline;
            cursor: pointer;
            background: none;
            border: none;
            padding: 0;
            font-size: inherit;
        }
        /* ── Modal ── */
        .privacy-modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.45);
            z-index: 9999;
            align-items: center;
            justify-content: center;
        }
        .privacy-modal-overlay.active { display: flex; }
        .privacy-modal {
            background: #fff;
            border-radius: 16px;
            max-width: 680px;
            width: 92%;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 8px 40px rgba(0,0,0,0.18);
        }
        .privacy-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 24px 16px;
            border-bottom: 1px solid #e5e7eb;
        }
        .privacy-modal-header h4 {
            margin: 0;
            font-size: 1.05rem;
            font-weight: 700;
            color: #111;
        }
        .privacy-modal-close {
            background: none;
            border: none;
            font-size: 1.4rem;
            color: #6b7280;
            cursor: pointer;
            line-height: 1;
            padding: 0 4px;
        }
        .privacy-modal-body {
            padding: 20px 24px;
            overflow-y: auto;
            font-size: 0.9rem;
            color: #374151;
            line-height: 1.6;
        }
        .privacy-modal-body p {
            margin: 0 0 4px;
        }
        .privacy-modal-body p:empty,
        .privacy-modal-body p br {
            display: none;
        }
        /* ── Submit ── */
        .sub-submit {
            display: block;
            width: 100%;
            padding: 16px;
            border: none;
            border-radius: 12px;
            background: #2563eb;
            font-size: 1rem;
            font-weight: 700;
            color: #fff;
            cursor: pointer;
            text-align: center;
            margin-top: 8px;
            transition: background 0.2s;
        }
        .sub-submit:hover { background: #1d4ed8; }
        .sub-footer-note { text-align: center; color: #9ca3af; font-size: 0.82rem; margin-top: 12px; }
        .sub-error { color: #dc2626; background: #fef2f2; border-radius: 8px; padding: 10px 14px; margin-bottom: 20px; font-size: 0.9rem; }

        @media (max-width: 640px) {
            .sub-hero h2 { font-size: 1.6rem; }
            .plan-grid { grid-template-columns: 1fr; }
            .sub-row { grid-template-columns: 1fr; }
        }
