:root {
    --bg-1: #f8fafc;
    --bg-2: #e2e8f0;
    --panel: rgba(255, 255, 255, 0.86);
    --panel-line: rgba(148, 163, 184, 0.35);
    --text: #0f172a;
    --muted: #64748b;
    --blue: #1d4ed8;
    --teal: #2dd4bf;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    box-sizing: border-box;
    background:
        radial-gradient(circle at 12% 10%, rgba(29, 78, 216, 0.18), transparent 34%),
        radial-gradient(circle at 90% 90%, rgba(45, 212, 191, 0.13), transparent 34%),
        linear-gradient(160deg, var(--bg-1), var(--bg-2));
    color: var(--text);
    font-family: 'Inter', 'Noto Sans KR', 'Segoe UI', sans-serif;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.login-container {
    width: min(100%, 430px);
    padding: 30px 24px;
    margin: 0 auto;
    border-radius: 22px;
    border: 1px solid var(--panel-line);
    background: var(--panel);
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.14);
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-container input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-container input::placeholder {
    color: #94a3b8;
}

.login-container input:focus {
    outline: none;
    border-color: rgba(29, 78, 216, 0.55);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.16);
}

.login-remember {
    margin: -2px 0 2px;
    font-size: 13px;
    color: var(--muted);
    text-align: left;
}

.login-remember label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.login-remember input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #1d4ed8;
}

.login-container button {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    box-shadow: 0 12px 24px rgba(29, 78, 216, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-container button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(29, 78, 216, 0.34);
}

.error-message {
    color: #b91c1c;
    font-size: 14px;
    margin-top: 8px;
}

.info-message {
    color: #065f46;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.32);
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 14px;
}

.login-step-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(29, 78, 216, 0.1);
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
}

.totp-setup-box {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.82);
    text-align: left;
}

.totp-setup-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.totp-setup-value {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.totp-qr-box {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.9));
}

.totp-qr-box.is-error {
    border-color: rgba(245, 158, 11, 0.38);
    background: rgba(255, 251, 235, 0.92);
}

.totp-qr-image {
    width: 220px;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    background: #fff;
    padding: 12px;
    box-sizing: border-box;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.totp-qr-fallback {
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
    text-align: center;
}

.totp-secret,
.totp-uri {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.6;
}

.totp-secret {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
}

.totp-uri {
    min-height: 96px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.login-link-btn {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    margin-top: 12px;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.login-link-btn:hover {
    color: #1d4ed8;
}

.image-box {
    margin-bottom: 20px;
}

#header-icon {
    cursor: pointer;
    max-width: 220px;
    height: auto;
}

.login-logo-subtitle {
    margin-top: 10px;
    font-size: 18px;
    font-weight: 300;
    color: #475569;
    letter-spacing: 0.01em;
}

.logo-text {
    display: inline-block;
    cursor: pointer;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.15;
    color: #0f172a;
    letter-spacing: -0.02em;
}

@media (max-width: 480px) {
    body { padding: 14px; }
    .login-container { padding: 24px 18px; border-radius: 18px; }
    .login-logo-subtitle { font-size: 16px; }
    .logo-text { font-size: 30px; }
}
