:root {
    --font-body: "BIZ UDPGothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
    --font-head: "BIZ UDPGothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
    --ink-900: #1b2434;
    --ink-800: #253249;
    --ink-700: #334155;
    --ink-600: #475569;
    --muted-500: #64748b;
    --surface-0: #ffffff;
    --surface-1: #f8fafc;
    --line-200: #e2e8f0;
    --line-300: #cbd5e1;
    --brand-600: #2a5bd7;
    --brand-500: #3b72f0;
    --accent-500: #12a3a6;
    --danger-500: #b4233a;
    --shadow-soft: 0 22px 50px rgba(15, 23, 42, 0.12);
    --radius-xl: 24px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/*
 * Account pages intentionally do not load Bootstrap.  Keep the small set of
 * browser-normalization rules that these pages actually use here so controls
 * retain their established dimensions and typography on desktop and mobile.
 */
body.app-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    color: var(--ink-900);
    background:
        radial-gradient(circle at 12% 18%, rgba(42, 91, 215, 0.08), transparent 45%),
        radial-gradient(circle at 86% 10%, rgba(18, 163, 166, 0.1), transparent 40%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body.app-body::before,
body.app-body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: 0;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    opacity: 0.6;
    filter: blur(0.5px);
}

body.app-body::before {
    top: -220px;
    right: -140px;
    background: radial-gradient(circle at 30% 30%, rgba(59, 114, 240, 0.26), rgba(59, 114, 240, 0) 70%);
}

body.app-body::after {
    bottom: -260px;
    left: -180px;
    background: radial-gradient(circle at 70% 70%, rgba(18, 163, 166, 0.22), rgba(18, 163, 166, 0) 70%);
}

h1,
h2,
h3,
h4,
h5 {
    margin: 0 0 8px;
    color: var(--ink-800);
    font-family: var(--font-head);
    font-weight: 600;
    letter-spacing: 0.02em;
}

p {
    margin: 0 0 12px;
}

a {
    color: var(--brand-600);
    text-decoration: none;
    transition: color 180ms ease;
}

a:hover {
    color: #0f766e;
}

input,
button,
select,
textarea {
    margin: 0;
    font: inherit;
}

input,
select,
textarea {
    max-width: 100%;
    font-family: var(--font-body);
}

button,
select {
    text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
}

label {
    display: inline-block;
}

small {
    font-size: 0.875em;
}

svg {
    vertical-align: middle;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 12px;
}

.form-row label {
    color: var(--ink-700);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.form-control,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    min-width: 160px;
    padding: 9px 12px;
    border: 1px solid var(--line-300);
    border-radius: var(--radius-sm);
    background: var(--surface-0);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.form-control {
    display: block;
    width: 100%;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ink-900);
    background-clip: padding-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control::placeholder {
    color: var(--muted-500);
    opacity: 1;
}

.form-control:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(59, 114, 240, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 114, 240, 0.18);
}

input[type="checkbox"] {
    accent-color: var(--brand-600);
}

.text-muted {
    color: var(--muted-500);
    font-size: 13px;
}

.text-info {
    color: #087990;
}

.text-success {
    color: #0f766e;
}

.text-danger {
    color: var(--danger-500);
}

.field-validation-error {
    display: block;
    margin-top: 3px;
    color: var(--danger-500);
    font-size: 12px;
    line-height: 1.4;
}

.btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.5;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    text-decoration: none;
    box-shadow: 0 10px 18px rgba(42, 91, 215, 0.22);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.btn:hover,
.btn:focus {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(42, 91, 215, 0.28);
}

.btn[disabled],
.btn.disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.btn-outline {
    border: 1px solid rgba(42, 91, 215, 0.5);
    background: var(--surface-0);
    color: var(--brand-600);
    box-shadow: none;
}

.btn-outline:hover,
.btn-outline:focus {
    background: rgba(42, 91, 215, 0.08);
    color: var(--brand-600);
    box-shadow: none;
}

.login-page {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(72px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}

.login-shell {
    position: relative;
    z-index: 1;
    max-width: 460px;
    margin: 72px auto;
    padding: 28px 30px;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-lg);
    background: var(--surface-0);
    box-shadow: var(--shadow-soft);
    animation: riseIn 650ms var(--ease-out-expo) both;
}

.login-page .login-shell {
    width: 100%;
    margin: 0;
}

.login-shell h1 {
    margin-top: 0;
    font-size: 28px;
    letter-spacing: 0.08em;
}

.login-status:not(:empty) {
    margin-bottom: 12px;
}

.login-status .text-danger,
.login-status .text-info {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: #f8fafc;
}

.login-shell .form-row label {
    flex: 0 0 100%;
    white-space: normal;
}

.login-shell .form-row .form-control,
.login-shell .form-row input[type="text"],
.login-shell .form-row input[type="password"],
.login-shell .form-row input[type="search"],
.login-shell .form-row input[type="email"],
.login-shell .form-row input[type="number"],
.login-shell .form-row select,
.login-shell .form-row textarea {
    flex: 1 1 100%;
    width: 100%;
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-field .form-control,
.password-field input[type="password"],
.password-field input[type="text"] {
    padding-right: 64px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--brand-600);
    cursor: pointer;
    line-height: 1;
    transform: translateY(-50%);
    transition: background-color 180ms ease, color 180ms ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    outline: none;
    background: rgba(59, 109, 242, 0.1);
    color: #214bb9;
}

.password-toggle.is-active {
    color: #214bb9;
}

.password-toggle__icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

.password-toggle__icon--visible,
.password-toggle.is-active .password-toggle__icon--hidden {
    display: none;
}

.password-toggle.is-active .password-toggle__icon--visible {
    display: block;
}

.login-shell .form-row input[type="checkbox"] {
    flex: 0 0 auto;
}

.login-shell .form-row input[type="checkbox"] + label {
    flex: 0 0 auto;
    width: auto;
    margin-left: 6px;
}

.login-shell .birthdate-input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: 12px;
}

.login-shell .birthdate-field {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 8px;
}

.login-shell .birthdate-field .form-control {
    min-width: 0;
    text-align: center;
}

.login-shell .birthdate-suffix {
    flex: 0 0 auto;
    align-self: center;
    color: var(--muted-500);
    font-weight: 700;
}

.login-shell .login-remember {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
}

.login-shell .login-remember label {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin: 0;
}

.login-shell .login-submit {
    width: 100%;
    min-height: 48px;
}

.login-shell .login-links {
    align-items: center;
}

.login-shell .login-links a + a::before {
    display: inline-block;
    margin: 0 8px;
    color: var(--muted-500);
    content: "/";
    font-weight: 700;
}

.password-reset-code-shell {
    max-width: 520px;
}

.login-shell .password-reset-code-input {
    min-height: 52px;
    color: #173f91;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
}

.password-reset-success {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 12px 0 4px;
    text-align: center;
}

.login-shell .password-reset-success h1 {
    margin: 0;
    letter-spacing: 0;
}

.password-reset-success p {
    margin: 0;
    color: var(--ink-700);
    line-height: 1.7;
}

.password-reset-success__action {
    min-width: 220px;
    margin-top: 8px;
}

.privacy-policy-page {
    position: relative;
    z-index: 1;
    max-width: 920px;
    margin: 48px auto 72px;
    padding: 0 20px;
}

.privacy-policy-container {
    padding: 32px 36px;
    overflow-wrap: anywhere;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-xl);
    background: var(--surface-0);
    color: var(--ink-700);
    line-height: 1.9;
    word-break: normal;
    box-shadow: var(--shadow-soft);
    animation: riseIn 650ms var(--ease-out-expo) both;
}

.privacy-policy-back-link {
    margin: 0 0 28px;
    font-size: 14px;
}

.privacy-policy-back-button {
    min-width: 0;
}

.privacy-policy-header {
    margin-bottom: 24px;
}

.privacy-policy-header h1 {
    margin: 0 0 18px;
    font-size: 32px;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

.privacy-policy-meta {
    display: grid;
    color: var(--ink-600);
    font-size: 15px;
    gap: 4px;
}

.privacy-policy-meta p,
.privacy-policy-container > p,
.privacy-policy-section p {
    margin: 0;
}

.privacy-policy-section {
    margin-top: 28px;
}

.privacy-policy-section h2 {
    margin: 0 0 10px;
    font-size: 21px;
    line-height: 1.5;
}

body.cnx-loading-open {
    cursor: progress;
}

.cnx-loading-overlay {
    position: fixed;
    z-index: 3000;
    inset: 0;
    display: grid;
    place-items: start center;
    padding: max(76px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
    background: rgba(15, 23, 42, 0.26);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms var(--ease-out-quart), visibility 180ms var(--ease-out-quart);
}

.cnx-loading-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cnx-loading-card {
    display: grid;
    justify-items: center;
    width: min(360px, 100%);
    padding: 20px 18px 18px;
    border: 1px solid rgba(191, 219, 254, 0.9);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.98);
    text-align: center;
    box-shadow: 0 24px 58px rgba(15, 23, 42, 0.22);
}

.cnx-loading-spinner {
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    border: 4px solid rgba(42, 91, 215, 0.16);
    border-top-color: var(--brand-600);
    border-radius: 50%;
    animation: cnx-loading-spin 850ms linear infinite;
}

.cnx-loading-title {
    color: var(--ink-800);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
}

.cnx-loading-text {
    margin-top: 4px;
    color: var(--muted-500);
    font-size: 13px;
    line-height: 1.6;
}

.btn.is-loading,
button.is-loading,
input[type="submit"].is-loading,
input[type="button"].is-loading,
a.is-loading {
    opacity: 0.72;
    pointer-events: none;
    transform: none;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes cnx-loading-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 720px), (pointer: coarse) {
    .login-page .form-row > a {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 44px;
        touch-action: manipulation;
    }
}

@media (max-width: 720px) {
    .login-page {
        min-height: 100vh;
        min-height: 100dvh;
        padding: calc(20px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    }

    .login-page .login-shell {
        padding: 22px 20px;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .form-row label {
        white-space: normal;
    }

    .btn {
        width: 100%;
    }

    .cnx-loading-overlay {
        align-items: end;
        padding: 16px 12px max(18px, env(safe-area-inset-bottom));
    }

    .cnx-loading-card {
        width: 100%;
        padding: 18px 16px 16px;
    }
}

@media (max-width: 640px) {
    .login-shell .birthdate-input-group {
        gap: 8px;
    }

    .login-shell .birthdate-field {
        gap: 6px;
    }

    .login-shell .birthdate-field .form-control {
        padding-right: 12px;
        padding-left: 12px;
    }

    .password-field .form-control,
    .password-field input[type="password"],
    .password-field input[type="text"] {
        padding-right: 60px;
    }

    .password-toggle {
        right: 10px;
        width: 44px;
        height: 44px;
    }

    .password-toggle__icon {
        width: 18px;
        height: 18px;
    }

    .privacy-policy-page {
        margin: 28px auto 48px;
        padding: 0 12px;
    }

    .privacy-policy-container {
        padding: 24px 18px;
        border-radius: var(--radius-lg);
        line-height: 1.8;
    }

    .privacy-policy-header h1 {
        font-size: 28px;
    }

    .privacy-policy-section {
        margin-top: 24px;
    }

    .privacy-policy-section h2 {
        font-size: 19px;
    }
}

@media (max-height: 600px) {
    .login-page {
        padding-top: calc(12px + env(safe-area-inset-top));
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .login-page .login-shell {
        padding-top: 18px;
        padding-bottom: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-shell,
    .privacy-policy-container {
        animation: none;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

