/* =============================================
    Base Reset & Layout
   ============================================= */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #C0CEE6;
    font-family: "Inter", "Hiragino Kaku Gothic ProN", sans-serif;
    overflow: hidden; 
}

.center-layout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* =============================================
    Auth Card
   ============================================= */
.auth-card {
    background: #FFFFFF;
    width: 100%;
    max-width: 480px; 
    padding: 50px 30px;
    border-radius: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
    box-sizing: border-box;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

/* --- 戻るボタン --- */
.back-btn {
    color: #5D8AA8;
    text-decoration: none;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.back-btn:hover {
    color: #4A738E;
    transform: translateX(-3px);
}

.spacer { width: 44px; }

/* =============================================
    Typography
   ============================================= */
.auth-card h2 {
    font-size: 26px;
    font-weight: 800;
    color: #334155;
    margin: 0;
}

.instruction {
    font-size: 18px;
    color: #64748B;
    margin-bottom: 40px;
    line-height: 1.6;
}

.instruction span {
    color: #4A738E;
    font-weight: 700;
}

.input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.code-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 30px;
}

.code-inputs input {
    width: 55px;
    height: 75px;
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    color: #475569;
    background: #FFFFFF;
    border: 2px solid #5D8AA8;
    border-radius: 14px;
    outline: none;
    transition: all 0.2s;
}

.code-inputs input:focus {
    background: #F8FAFF;
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.code-inputs input::placeholder {
    color: #E2E8F0;
}

/* エラー時の入力枠（JSで付与） */
.input-error {
    border-color: #EF4444 !important;
    background-color: #FFF1F1 !important;
}

/* =============================================
    Submit Button
   ============================================= */
.submit-btn {
    width: 100%;
    max-width: 320px;
    padding: 18px;
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    background: #5D8AA8;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
    transition: all 0.3s;
}

.submit-btn:hover {
    background: #4A738E;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.35);
}

.footer-area {
    margin-top: 35px;
}

.footer-area p {
    font-size: 19px;
    color: #94A3B8;
}

.footer-area a {
    color: #5D8AA8;
    text-decoration: none;
    font-weight: 700;
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

.footer-area a:hover {
    color: #4A738E;
}

.error-message {
    display: none;
    font-size: 17px;
    color: #EF4444;
    background: #FEF2F2;
    padding: 12px;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
    margin: 10px 0 20px 0;
}

.error-message.show {
    display: block;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* =============================================
    Mobile Responsive
   ============================================= */
@media screen and (max-width: 480px) {
    .auth-card {
        padding: 40px 15px;
        margin: 10px;
    }
    .code-inputs {
        gap: 6px;
    }
    .code-inputs input {
        width: 45px;
        height: 60px;
        font-size: 28px;
        border-radius: 10px;
    }
    .auth-card h2 { font-size: 20px; }
    .instruction { font-size: 14px; }
    .footer-area p { font-size: 16px; }
}