.otp-page { min-height: 100svh; margin: 0; padding: 32px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; background: #faf9fa; color: #211d24; color-scheme: light; }
.otp-brand { display: flex; align-items: center; gap: 10px; color: #625a67; font-size: 14px; }
.otp-brand img { object-fit: contain; border-radius: 6px; }
.otp-card { container-type: inline-size; position: relative; isolation: isolate; width: min(640px, 100%); padding: 100px 40px 36px; border: 2px solid #e9e4eb; border-radius: 60px; background: #fff; overflow: hidden; box-shadow: 0 18px 58px #2415270a; animation: otp-arrive 850ms cubic-bezier(.16,1,.3,1) both; }
.otp-handle { position: absolute; top: 24px; left: 50%; width: 64px; height: 5px; transform: translateX(-50%); background: #d8d1db; border-radius: 6px; }
.otp-ambient { position: absolute; z-index: -1; inset: -10%; opacity: 0; background: radial-gradient(ellipse at 50% 53%, #13884324, #175d3412 33%, transparent 68%); transition: opacity 1.2s ease; }
.otp-header { text-align: center; transition: opacity 220ms, transform 300ms; }
.otp-eyebrow { color: #625a67; font-size: 12px; }
.otp-header h1 { font-size: clamp(25px, 6cqw, 38px); font-weight: 750; line-height: 1.5; margin: 12px 0 0; }
.otp-header p { font-size: clamp(12px, 2.9cqw, 17px); line-height: 1.9; color: #655d6a; margin: 18px 0 0; }
.otp-factory-name { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 19px; font-weight: 800; color: #625a67; overflow-wrap: anywhere; }
.otp-factory-name img { object-fit: contain; flex-shrink: 0; }
.otp-staff-welcome .otp-factory-name { font-size: clamp(25px, 6cqw, 38px); font-weight: 750; color: inherit; line-height: 1.5; }
.otp-staff-welcome h1, .otp-staff-welcome p { font-size: clamp(14px, 3.5cqw, 19px); line-height: 1.9; }
.otp-staff-welcome h1 { color: #625a67; font-weight: 800; }
.otp-staff-welcome p { margin-top: 4px; }
.otp-form { margin-top: 48px; }
.otp-code-area { position: relative; }
.otp-native-code { width: 100%; height: 72px; border: 2px solid #cfc6d1; border-radius: 20px; background: #f8f6f9; color: #211d24; text-align: center; font-size: 28px; letter-spacing: .5em; }
.otp-digits { display: none; }
.otp-enhanced .otp-entry { position: relative; }
.otp-enhanced .otp-native-code { position: absolute; z-index: 2; inset: 0; height: 100%; opacity: 0; cursor: text; }
.otp-enhanced .otp-digits { display: flex; gap: 2cqw; justify-content: center; }
.otp-digit { position: relative; display: grid; place-items: center; flex: 1; min-width: 0; aspect-ratio: 1; border-radius: 3cqw; background: #f8f6f9; box-shadow: inset 0 0 0 2px #dcd5de; font-size: clamp(24px, 6cqw, 38px); font-weight: 500; transition: transform 650ms cubic-bezier(.65,0,.2,1), opacity 450ms, box-shadow 250ms; }
.otp-trace { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; pointer-events: none; transition: opacity 250ms; }
.otp-trace rect { fill: none; stroke: #be422e; stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 20 80; stroke-dashoffset: 18; }
.otp-entry:focus-within .otp-digit[data-active] .otp-trace, [data-state="tracing"] .otp-trace { opacity: 1; }
.otp-entry:focus-within .otp-digit[data-active] .otp-trace rect { animation: otp-trace 2800ms linear infinite; }
[data-state="tracing"] .otp-trace rect { animation: otp-trace 700ms linear infinite; }
.otp-result { position: absolute; width: 90px; height: 90px; top: 50%; left: 50%; border-radius: 24px; background: #fff; opacity: 0; transform: translate(-50%, -50%) scale(.76); transition: opacity 400ms, transform 650ms cubic-bezier(.16,1,.3,1); pointer-events: none; }
.otp-result-border { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.otp-result-border rect { fill: none; stroke: #9b8e9e; stroke-width: 3.3; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 800ms; }
.otp-spinner, .otp-check { position: absolute; width: 46%; height: 46%; top: 27%; left: 27%; fill: none; stroke: #211d24; stroke-linecap: round; stroke-linejoin: round; stroke-width: 5; }
.otp-spinner { opacity: 0; animation: otp-spin 850ms linear infinite; }
.otp-spinner circle { stroke-dasharray: 14 81; }
.otp-check { visibility: hidden; }
.otp-check path { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 500ms cubic-bezier(.16,1,.3,1); }
[data-state="merging"] .otp-digit { transform: translateX(calc((2.5 - var(--i)) * (100% + 2cqw))) scale(.94); opacity: 0; }
[data-state="verifying"] .otp-entry, [data-state="success"] .otp-entry { visibility: hidden; }
[data-state="verifying"] .otp-result, [data-state="success"] .otp-result { opacity: 1; transform: translate(-50%, -50%) scale(1); }
[data-state="verifying"] .otp-result-border rect, [data-state="success"] .otp-result-border rect { stroke-dashoffset: 0; }
[data-state="verifying"] .otp-spinner { opacity: 1; }
[data-state="success"] .otp-check { visibility: visible; }
[data-state="success"] .otp-result-border rect { stroke: #208751; }
[data-state="success"] .otp-check path { stroke-dashoffset: 0; transition-delay: 150ms; }

[data-state="success"] .otp-ambient { opacity: 1; }
[data-state="error"] .otp-entry { animation: otp-shake 350ms ease; }
[data-state="error"] .otp-digit { box-shadow: inset 0 0 0 2px #be422e; }
.otp-submit { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; min-height: 48px; margin-top: 24px; border: 1px solid #dcd5de; border-radius: 14px; background: #28212c; color: #fff; font-weight: 700; transition: opacity 200ms, transform 200ms; }
.otp-submit:hover { opacity: .85; }
.otp-submit:active { transform: scale(.98); }
.otp-submit:disabled { opacity: .45; cursor: wait; }
.otp-message { text-align: center; font-size: 12px; line-height: 1.9; }
.otp-error { color: #a53324; margin-top: 12px; }
.otp-error:empty { display: none; }
.otp-notice { color: #655d6a; margin-top: 20px; }
.otp-footer { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 32px; font-size: 14px; color: #655d6a; }
.otp-footer > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; align-items: baseline; }
.otp-footer button { color: #28212c; font-weight: 600; }
.otp-footer button:hover { color: #be422e; }
.otp-footer button:disabled { opacity: .4; }
.otp-footer .otp-change { color: #655d6a; font-size: 12px; }
.otp-card button:focus-visible, .otp-brand:focus-visible, .otp-staff a:focus-visible { outline: 2px solid #be422e; outline-offset: 5px; }
.otp-mobile-form { max-width: 360px; margin: 36px auto 0; }
.otp-mobile-form label { display: block; margin-bottom: 10px; font-size: 13px; color: #625a67; }
.otp-mobile-form input[name="mobile"] { width: 100%; height: 60px; padding: 0 18px; border: 2px solid #dcd5de; border-radius: 16px; background: #f8f6f9; color: #211d24; font-size: 20px; letter-spacing: .12em; outline: none; }
.otp-mobile-form input:focus { border-color: #be422e; }
.otp-password-option { max-width: 360px; margin: 26px auto 0; border-top: 1px solid #e9e4eb; }
.otp-password-option summary { padding: 18px 4px 10px; color: #625a67; text-align: center; font-size: 14px; font-weight: 650; cursor: pointer; list-style: none; }
.otp-password-option summary::-webkit-details-marker { display: none; }
.otp-password-option summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-inline-end: 8px; border: 1px solid #dcd5de; border-radius: 50%; font-size: 16px; line-height: 1; }
.otp-password-option[open] summary::before { content: "−"; }
.otp-password-option summary:hover { color: #be422e; }
.otp-password-option summary:focus-visible { outline: 2px solid #be422e; outline-offset: 4px; border-radius: 6px; }
.otp-password-form { display: grid; gap: 10px; padding: 8px 0 4px; }
.otp-password-form > label:not(.otp-password-remember) { color: #625a67; font-size: 13px; }
.otp-password-form > input { width: 100%; min-height: 52px; padding: 0 14px; border: 2px solid #dcd5de; border-radius: 14px; background: #f8f6f9; color: #211d24; outline: none; }
.otp-password-form > input:focus { border-color: #be422e; }
.otp-password-form > input[aria-invalid="true"] { border-color: #a53324; }
.otp-password-help { margin: 0; color: #655d6a; text-align: center; font-size: 12px; line-height: 1.8; }
.otp-password-remember { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; color: #655d6a; font-size: 13px; }
.otp-staff { color: #655d6a; font-size: 12px; }
.otp-staff a { text-decoration: underline; text-underline-offset: 4px; }
.otp-terms-notice { margin-top: 14px; text-align: center; }
.otp-terms { margin-top: 24px; max-height: 60vh; overflow-y: auto; text-align: start; font-size: 14px; line-height: 2; color: #3d3641; }
.otp-terms p + p { margin-top: 12px; }
@keyframes otp-arrive { from { opacity: 0; transform: translateY(22px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes otp-spin { to { transform: rotate(360deg); } }
@keyframes otp-trace { to { stroke-dashoffset: -82; } }
@keyframes otp-shake { 25%, 75% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }
@media (max-width: 680px) { .otp-card { padding: 72px 20px 28px; border-radius: 36px; } .otp-form { margin-top: 36px; } .otp-result { width: 64px; height: 64px; border-radius: 18px; } .otp-footer { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .otp-page *, .otp-page *::before, .otp-page *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; } }

.otp-mobile-form input, .otp-native-code, .otp-header bdi { -webkit-user-select: text; user-select: text; cursor: text; }
.otp-mobile-form input::selection, .otp-header bdi::selection { background: #f9d4c9; color: #211d24; }
.otp-digit[data-selected] { background: #fbe4dd; box-shadow: inset 0 0 0 2px #be422e; }

.otp-native-code:focus-visible { outline: 2px solid #be422e; outline-offset: 3px; }
