:root {
    color-scheme: light;
    --bg: #f3f6fb;
    --surface: rgba(255, 255, 255, 0.96);
    --text: #172033;
    --muted: #64748b;
    --line: #dce3ee;
    --primary: #3157d5;
    --primary-dark: #2445b6;
    --danger: #b42318;
    --danger-bg: #fff3f1;
    --focus: rgba(49, 87, 213, 0.2);
    font-family: Inter, "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 0%, rgba(80, 111, 230, 0.14), transparent 30rem),
        radial-gradient(circle at 100% 90%, rgba(65, 190, 170, 0.12), transparent 28rem),
        var(--bg);
}

.page-shell {
    width: min(100% - 32px, 940px);
    margin-inline: auto;
    padding: 64px 0;
}

.contact-card {
    padding: clamp(28px, 5vw, 56px);
    border: 1px solid rgba(220, 227, 238, 0.85);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 22px 65px rgba(23, 32, 51, 0.1);
    backdrop-filter: blur(8px);
}

.intro { margin-bottom: 32px; }
.eyebrow { color: var(--primary); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.16em; }
h1 { margin: 8px 0 12px; font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.2; }
p { color: var(--muted); line-height: 1.8; }

.alert {
    margin-bottom: 28px;
    padding: 16px 18px;
    color: var(--danger);
    border: 1px solid #f7c8c2;
    border-radius: 12px;
    background: var(--danger-bg);
}
.alert ul { margin: 8px 0 0; padding-left: 1.3em; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; }
.required, .optional { padding: 2px 7px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.required { color: #fff; background: var(--primary); }
.optional { color: var(--muted); background: #edf1f7; }

input, textarea {
    width: 100%;
    padding: 13px 14px;
    color: var(--text);
    font: inherit;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: #fff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}
textarea { resize: vertical; min-height: 180px; line-height: 1.7; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus); }
small { display: block; margin-top: 7px; color: var(--muted); }
.recaptcha-wrap { margin: 28px 0 20px; overflow-x: auto; }

.submit-button, .back-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 52px;
    padding: 0 28px;
    color: #fff;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    box-shadow: 0 10px 24px rgba(49, 87, 213, 0.24);
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
}
.submit-button:hover, .back-link:hover { background: var(--primary-dark); transform: translateY(-1px); }
.submit-button:focus-visible, .back-link:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }

.thanks-card { max-width: 680px; margin-inline: auto; text-align: center; }
.success-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 24px; color: #fff; font-size: 2rem; border-radius: 50%; background: #16a085; box-shadow: 0 12px 28px rgba(22, 160, 133, 0.24); }
.thanks-card .back-link { margin-top: 16px; }

@media (max-width: 640px) {
    .page-shell { width: min(100% - 20px, 940px); padding: 20px 0; }
    .contact-card { padding: 24px 18px; border-radius: 18px; }
    .form-grid { grid-template-columns: 1fr; gap: 18px; }
    .field-wide { grid-column: auto; }
    .submit-button { width: 100%; }
    .g-recaptcha { transform-origin: left top; }
}

@media (max-width: 360px) {
    .g-recaptcha { transform: scale(0.88); margin-bottom: -8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
