* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 60% 25%, #4066d8 0%, #2a52be 50%, #1a3aaa 100%);
}

.card {
    padding: 2.4rem;
    width: 100%;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 22px;
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

/* ── Step transitions ── */
.step {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.26s ease, transform 0.26s ease;
}

.step.hidden {
    display: none;
}

.step.slide-out {
    opacity: 0;
    transform: translateX(-18px);
}

.step.entering {
    opacity: 0;
    transform: translateX(18px);
    transition: none;
}

/* ── Step 1: Login ── */
form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    font-size: 0.97rem;
    font-family: inherit;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    outline: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

button {
    width: 100%;
    padding: 0.9rem;
    font-size: 0.97rem;
    font-weight: 600;
    font-family: inherit;
    color: #2a52be;
    background: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);

    opacity: 0;
    transform: translateY(6px);
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    transition:
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.15s,
        box-shadow 0.15s;
}

button.visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 60px;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    margin-top: 0.25rem;
}

button:hover { background: #f0f4ff; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); }
button:active { transform: scale(0.98); }

/* ── Step 2: OTP ── */
.otp-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.otp-digit {
    width: 36px !important;
    height: 44px;
    padding: 0;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    caret-color: transparent;
    border-radius: 10px;
    flex: 0 0 36px;
    margin-right: 0.45rem;
}

.otp-digit:last-of-type {
    margin-right: 0;
}

.otp-digit:focus {
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.22);
}

#otp-btn {
    flex-shrink: 0;
    width: 36px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);

    /* 초기: 접혀있음 */
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    margin-left: 0;
    transition:
        max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.15s,
        box-shadow 0.15s;
}

#otp-btn.visible {
    max-width: 36px;
    opacity: 1;
    margin-left: 0.45rem;
}

#otp-btn:hover { background: #f0f4ff; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); }
#otp-btn:active { transform: scale(0.96); }
