/**
 * マイページ（学生ダッシュボード）のレイアウト。
 *
 * TVS_Router::render_dashboard は get_header()/get_footer() の間にコンテンツを直接
 * 描画するため、テーマのコンテンツ幅コンテナに乗らず、放置すると見出しや模試カードが
 * 画面幅いっぱいに広がる。資料セクション（.tvs-documents-section は pdf-viewer.css で
 * max-width:1200px + margin:auto を持つ）に合わせ、全体を中央寄せの1カラムに収める。
 */

.examportal-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    box-sizing: border-box;
}

.examportal-greeting {
    color: #555;
    margin: 0 0 16px;
}

.examportal-section {
    margin-bottom: 40px;
}

.examportal-section:last-child {
    margin-bottom: 0;
}

.examportal-section-title {
    margin: 0 0 16px;
}

.examportal-empty {
    color: #777;
}

.examportal-pay-spinner {
    width: 1em;
    height: 1em;
    margin-right: 0.4em;
    border: 2px solid #d0d7de;
    border-top-color: #555;
    border-radius: 50%;
    display: inline-block;
    vertical-align: -0.1em;
    animation: examportal-spin 0.8s linear infinite;
}

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

.examportal-dashboard input[type="text"],
.examportal-dashboard input[type="email"] {
    width: 100%;
    max-width: 24em;
    box-sizing: border-box;
}

.examportal-dashboard form button {
    margin-top: 12px;
}

/* Seller-facing Stripe invitation and embedded onboarding pages. */
.examportal-connect {
    width: calc(100% - 40px);
    max-width: 760px;
    margin: clamp(28px, 5vw, 56px) auto 64px;
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid #e6e1f2;
    border-radius: 16px;
    background: #ffffff;
    color: #221c33;
}

.examportal-connect--embedded {
    max-width: 960px;
}

.examportal-connect h1 {
    margin: 0 0 20px;
    line-height: 1.35;
}

.examportal-connect p {
    line-height: 1.75;
}

.examportal-connect__mode {
    display: inline-block;
    margin: 0 0 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f6f4ff;
    color: #4f46c8;
    font-size: 0.875rem;
    font-weight: 700;
}

.examportal-connect__lead {
    font-size: 1.0625rem;
    font-weight: 600;
}

.examportal-connect__note {
    padding-left: 12px;
    border-left: 3px solid #4f46c8;
    color: #645d74;
}

.examportal-connect__next {
    margin: 28px 0 0;
    padding: 16px 18px;
    border-radius: 12px;
    background: #f6f4ff;
}

.examportal-connect__dashboard-link {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 22px;
    border-radius: 999px;
    background: #4f46c8;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

.examportal-connect form {
    margin-top: 28px;
}

.examportal-connect button {
    min-height: 48px;
    padding: 10px 22px;
    border: 0;
    border-radius: 999px;
    background: #4f46c8;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.examportal-connect :is(button, a):focus-visible {
    outline: 3px solid #4f46c8;
    outline-offset: 3px;
}

/*
 * Buyer-facing purchase, payment-link and completion pages.
 * トップページ(D2)の配色・角・罫線に揃える。
 * paper #F8F5EE / surface #FFFEFA / ink #09294F / muted #405B70 / link #087DB8
 */
.examportal-purchase {
    max-width: 760px;
    padding: clamp(28px, 5vw, 56px) 20px 64px;
}

.examportal-purchase--card {
    width: calc(100% - 48px);
    max-width: 800px;
    margin: clamp(32px, 6vw, 72px) auto 88px;
    padding: clamp(28px, 4.5vw, 52px);
    border: 1px solid rgba(9, 41, 79, 0.22);
    border-radius: 0;
    background: #fffefa;
    color: #09294f;
    letter-spacing: 0.015em;
}

.examportal-purchase h1 {
    margin: 0 0 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(9, 41, 79, 0.22);
    font-size: clamp(26px, 3.3vw, 36px);
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.examportal-purchase p {
    line-height: 1.9;
}

.examportal-purchase a {
    color: #087db8;
    text-underline-offset: 0.2em;
}

.examportal-purchase form {
    margin: 32px 0 0;
}

.examportal-purchase label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
}

.examportal-purchase select,
.examportal-purchase input[type="text"],
.examportal-purchase input[type="email"] {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid rgba(9, 41, 79, 0.5);
    border-radius: 0;
    background: #fff;
    color: #09294f;
    font: inherit;
}

.examportal-purchase :is(select, input, button, a):focus-visible {
    outline: 3px solid #09294f;
    outline-offset: 3px;
}

.examportal-purchase button {
    min-height: 52px;
    padding: 10px 24px;
    border: 1px solid #09294f;
    border-radius: 0;
    background: #09294f;
    color: #f8f5ee;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.examportal-purchase--form form button,
.examportal-purchase--payment form button {
    width: 100%;
    max-width: 100%;
    min-height: 56px;
    margin-top: 16px;
}

.examportal-purchase button:hover {
    border-color: #087db8;
    background: #087db8;
    color: #fff;
}

.examportal-payment-share {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(9, 41, 79, 0.22);
}

.examportal-payment-own {
    margin-top: 24px;
}

.examportal-payment-methods {
    margin: 24px 0 32px;
    padding: 20px;
    border: 1px solid rgba(9, 41, 79, 0.12);
    border-radius: 0;
    background: #f8f5ee;
}

.examportal-payment-methods h2 {
    margin: 0 0 14px;
    font-size: 1.125rem;
    font-weight: 600;
}

.examportal-payment-methods ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.examportal-payment-methods li {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid rgba(9, 41, 79, 0.22);
    border-radius: 0;
    background: #fffefa;
    color: #09294f;
    font-size: 14px;
    font-weight: 600;
}

.examportal-payment-methods p {
    margin: 12px 0 0;
    color: #405b70;
    font-size: 0.875rem;
}

.examportal-payment-own h2,
.examportal-payment-share h2 {
    margin: 0 0 12px;
    font-size: 1.125rem;
    font-weight: 600;
}

.examportal-payment-share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.examportal-payment-share-actions button {
    margin: 0;
}

.examportal-payment-share .examportal-purchase-copy-button {
    border: 1px solid #09294f;
    background: transparent;
    color: #09294f;
}

.examportal-payment-share .examportal-purchase-copy-button:hover {
    border-color: #087db8;
    background: #087db8;
    color: #fff;
}

.examportal-purchase-summary {
    margin: 20px 0 28px;
    padding: 18px 20px;
    border: 1px solid rgba(9, 41, 79, 0.22);
    border-radius: 0;
    background: #f8f5ee;
    color: #09294f;
}

.examportal-purchase-summary[hidden] {
    display: none;
}

.examportal-purchase-summary > div {
    display: grid;
    grid-template-columns: 5.5em minmax(0, 1fr);
    gap: 12px;
    padding: 6px 0;
}

.examportal-purchase-summary dt {
    color: #405b70;
}

.examportal-purchase-summary dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.examportal-purchase-note {
    color: #405b70;
    font-size: 0.9375rem;
}

.examportal-purchase-help {
    margin: 24px 0 0;
    padding: 20px;
    border: 1px solid rgba(9, 41, 79, 0.12);
    background: #f8f5ee;
}

.examportal-purchase-help h2 {
    margin: 0 0 12px;
    font-size: 1.125rem;
    font-weight: 600;
}

.examportal-purchase-help ul {
    margin: 0 0 12px;
    padding-left: 1.25em;
}

.examportal-purchase-help p {
    margin: 0;
}

.examportal-purchase .examportal-pay-spinner {
    border-color: rgba(9, 41, 79, 0.2);
    border-top-color: #087db8;
}

@media (max-width: 560px) {
    .examportal-purchase--card {
        width: calc(100% - 32px);
        margin-bottom: 56px;
    }

    .examportal-purchase-summary > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/*
 * 資料セクションは pdf-viewer.css で自前の max-width:1200px + margin:auto + padding:20px を
 * 持つ。ダッシュボード内では二重コンテナになり、模試セクションと左右がずれる。
 * ダッシュボード配下では自前コンテナを打ち消し、他セクションと左端を揃える。
 */
.examportal-dashboard .tvs-documents-section {
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
}
