* {
    box-sizing: border-box;
}

:root {
    --ink: #16172b;
    --ink-soft: #63667e;
    --surface: #ffffff;
    --border: #e6e4f2;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-tint: #eef0ff;
    --danger: #e11d48;
    --success: #15803d;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(22, 15, 65, 0.05);
    --shadow-md: 0 18px 40px -18px rgba(30, 20, 90, 0.28);
}

html, body {
    height: 100%;
    margin: 0;
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    color: var(--ink);
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
}

body {
    background:
        radial-gradient(circle at 12% 8%, rgba(79, 70, 229, 0.10) 0%, transparent 42%),
        radial-gradient(circle at 88% 92%, rgba(225, 29, 72, 0.08) 0%, transparent 40%),
        #faf9ff;
}

.app {
    position: relative;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    text-align: center;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.99);
    transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.screen-title {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 28px;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 56px;
}

.logo-gdg {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(120deg, var(--primary) 0%, #7c3aed 45%, var(--danger) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-sub {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.btn {
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    padding: 17px 28px;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-wide {
    width: 100%;
    max-width: 360px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 12px 24px -10px rgba(79, 70, 229, 0.55);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    border-color: #c9c5e8;
    background: #faf9ff;
}

.btn[disabled] {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.terms-box {
    width: 100%;
    max-width: 640px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 28px;
    margin-bottom: 26px;
    font-size: 16px;
    line-height: 1.75;
    color: var(--ink-soft);
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.terms-box p {
    margin: 0 0 14px;
}

.terms-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.terms-list li {
    padding-left: 14px;
    border-left: 2px solid var(--border);
}

.terms-list strong {
    display: block;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 3px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 34px;
    cursor: pointer;
}

.checkbox-row input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.digits {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.digit {
    width: 50px;
    height: 60px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.digit:not(:empty) {
    border-color: var(--primary);
    box-shadow: 0 8px 18px -10px rgba(79, 70, 229, 0.5);
    transform: translateY(-1px);
}

.error-msg {
    min-height: 20px;
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    margin: 10px 0 18px;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 78px);
    gap: 13px;
}

.num {
    height: 66px;
    font-size: 22px;
    font-weight: 700;
    font-family: inherit;
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.num:hover {
    box-shadow: 0 10px 22px -14px rgba(22, 15, 65, 0.35);
}

.num:active {
    background: #f2f1fb;
    transform: scale(0.95);
}

.num-clear {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.num-confirm {
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: 0 12px 22px -10px rgba(79, 70, 229, 0.55);
}

.num-confirm:hover {
    background: var(--primary-dark);
}

.num-confirm[disabled] {
    background: var(--surface);
    color: var(--ink-soft);
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.name-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin-bottom: 26px;
    max-height: 42vh;
    overflow-y: auto;
    padding: 2px;
}

.btn-name {
    width: 100%;
    padding: 17px;
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.08s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-name:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 22px -14px rgba(79, 70, 229, 0.4);
}

.btn-name:active {
    transform: scale(0.98);
}

.confirm-text {
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 44px;
}

.confirm-buttons {
    display: flex;
    gap: 16px;
}

.confirm-buttons .btn {
    min-width: 140px;
}

.result-text {
    font-size: 25px;
    font-weight: 800;
    color: var(--success);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.result-text::before {
    content: "";
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e6f6ec;
    box-shadow: inset 0 0 0 2px rgba(21, 128, 61, 0.25);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 28px;
}
