@font-face {
    font-family: "NexonCartGothic";
    src: url("assets/fonts/KartriderExtraBold.woff2") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: 800;
}

@font-face {
    font-family: "Paperozi";
    src: url("assets/fonts/Paperlogy-4Regular.woff2") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

@font-face {
    font-family: "Paperozi";
    src: url("assets/fonts/Paperlogy-5Medium.woff2") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: 500;
}

@font-face {
    font-family: "Paperozi";
    src: url("assets/fonts/Paperlogy-7Bold.woff2") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: 700;
}

:root {
    color-scheme: light;
    --bg: #fff8f3;
    --surface: #fffdfb;
    --surface-strong: #ffffff;
    --text: #342a30;
    --text-soft: #695961;
    --muted: #98848d;
    --line: rgba(106, 72, 86, 0.14);
    --accent: #e96d70;
    --accent-strong: #d9585d;
    --accent-soft: #fff0ec;
    --lavender: #7c63b7;
    --blue: #69a9d6;
    --success: #48a77d;
    --danger: #d95260;
    --shadow: 0 28px 70px rgba(120, 75, 91, 0.16);
    --font-sans: "Paperozi", sans-serif;
    --font-title: "NexonCartGothic", "Paperozi", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--bg);
}

body {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 96% 4%, rgba(244, 190, 83, 0.18), transparent 25rem),
        radial-gradient(circle at 2% 70%, rgba(116, 185, 229, 0.15), transparent 30rem),
        linear-gradient(145deg, #fffaf6 0%, #fff5ef 48%, #fff9f5 100%);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.5;
    word-break: keep-all;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

.ambient-dots {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    opacity: 0.52;
    background-image: radial-gradient(rgba(217, 88, 93, 0.17) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.ambient-shape {
    position: fixed;
    z-index: -2;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(105px);
    opacity: 0.15;
}

.ambient-shape-coral {
    top: -17rem;
    right: -10rem;
    background: #ff9f91;
}

.ambient-shape-blue {
    bottom: -19rem;
    left: -11rem;
    background: #82c6e8;
}

.login-shell {
    display: flex;
    width: min(1360px, 100%);
    min-height: 100dvh;
    margin: 0 auto;
    padding: 28px 34px 22px;
    flex-direction: column;
}

.login-stage {
    display: grid;
    min-height: 710px;
    overflow: hidden;
    grid-template-columns: minmax(0, 1.25fr) minmax(390px, 0.75fr);
    border: 1px solid rgba(118, 77, 92, 0.13);
    border-radius: 30px;
    background: rgba(255, 253, 251, 0.94);
    box-shadow: var(--shadow);
}

.story-panel {
    position: relative;
    display: flex;
    min-width: 0;
    overflow: hidden;
    padding: 52px 54px 34px;
    flex-direction: column;
    background:
        radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.8), transparent 18rem),
        linear-gradient(135deg, #fff0e9 0%, #fff8e9 100%);
}

.story-panel::before {
    position: absolute;
    top: -14rem;
    right: -7rem;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    background: rgba(255, 190, 180, 0.35);
    box-shadow: 0 0 0 55px rgba(255, 255, 255, 0.14), 0 0 0 110px rgba(255, 255, 255, 0.08);
    content: "";
}

.story-panel::after {
    position: absolute;
    top: 34px;
    right: 38px;
    color: rgba(217, 88, 93, 0.26);
    content: "✦  { }  ♡  +";
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.45em;
    transform: rotate(2deg);
}

.story-copy {
    position: relative;
    z-index: 4;
    max-width: 630px;
}

.service-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid rgba(72, 167, 125, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.64);
    color: #3b8c69;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.service-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(72, 167, 125, 0.13);
}

.eyebrow {
    margin: 30px 0 10px;
    color: var(--accent-strong);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.story-copy h1 {
    margin: 0;
    font-family: var(--font-title);
    font-size: clamp(2.65rem, 4vw, 4.65rem);
    font-weight: 800;
    letter-spacing: -0.065em;
    line-height: 1.04;
}

.story-copy h1 span {
    color: var(--accent);
}

.story-description {
    max-width: 550px;
    margin: 22px 0 0;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.75;
}

.login-hero {
    position: absolute;
    inset: 0;
    z-index: 1;
    margin: 0;
    pointer-events: none;
}

.login-hero::after {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(90deg, #fff1e9 0%, rgba(255, 243, 234, 0.95) 32%, rgba(255, 244, 234, 0.63) 46%, rgba(255, 244, 234, 0.04) 68%),
        linear-gradient(0deg, #fff7e9 4%, rgba(255, 247, 233, 0.12) 35%, transparent 55%);
    content: "";
}

.login-hero video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 35% center;
    transform: scale(1.08) translate(4%, 7%);
}

.hero-chip {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    padding: 7px 11px;
    border: 2px solid rgba(80, 56, 66, 0.1);
    border-radius: 10px 10px 10px 3px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    box-shadow: 0 9px 20px rgba(126, 82, 96, 0.12);
}

.hero-chip-player {
    right: 6%;
    bottom: 39%;
    color: var(--lavender);
    transform: rotate(5deg);
}

.hero-chip-xp {
    right: 30%;
    bottom: 24%;
    background: #fff3c8;
    color: #a46f0f;
    transform: rotate(-5deg);
}

.hero-chip-byte {
    right: 7%;
    bottom: 17%;
    color: var(--accent-strong);
    transform: rotate(3deg);
}

.service-track {
    position: relative;
    z-index: 5;
    display: grid;
    width: min(610px, 100%);
    margin-top: auto;
    grid-template-columns: auto minmax(50px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(106, 72, 86, 0.11);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(12px);
    box-shadow: 0 14px 34px rgba(126, 82, 96, 0.1);
}

.service-track > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.track-icon {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.track-icon-pyrun {
    padding: 0;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    box-shadow: none;
    filter: drop-shadow(0 5px 8px rgba(124, 99, 183, 0.2));
}

.track-icon-quest {
    padding: 0;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    box-shadow: none;
    filter: drop-shadow(0 5px 8px rgba(124, 99, 183, 0.2));
}

.service-track div > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.service-track small {
    color: var(--muted);
    font-size: 0.62rem;
}

.service-track strong {
    margin-top: 2px;
    font-size: 0.78rem;
}

.track-line {
    position: relative;
    display: block;
    height: 2px;
    overflow: visible;
    background: repeating-linear-gradient(90deg, rgba(124, 99, 183, 0.25) 0 6px, transparent 6px 11px);
}

.track-line i {
    position: absolute;
    top: 50%;
    left: 48%;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 5px rgba(233, 109, 112, 0.13);
    transform: translate(-50%, -50%);
}

.form-panel {
    position: relative;
    z-index: 6;
    display: flex;
    min-width: 0;
    padding: 58px 54px 38px;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid rgba(106, 72, 86, 0.1);
    background: rgba(255, 253, 251, 0.96);
}

.form-step {
    color: var(--accent-strong);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.form-heading h2 {
    margin: 10px 0 6px;
    background: linear-gradient(100deg, var(--accent-strong) 0%, #8b6bd3 88%);
    background-clip: text;
    color: var(--lavender);
    font-family: var(--font-title);
    font-size: clamp(1.55rem, 2.2vw, 2.15rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.login-form {
    display: grid;
    gap: 17px;
    margin-top: 32px;
}

.field-group {
    display: grid;
    gap: 7px;
}

.field-group label {
    font-size: 0.78rem;
    font-weight: 700;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field-label-row > span {
    color: var(--muted);
    font-size: 0.64rem;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    z-index: 2;
    display: grid;
    width: 22px;
    place-items: center;
    color: #ad929d;
    font-size: 0.82rem;
    font-weight: 700;
    pointer-events: none;
}

.input-icon-school {
    color: #a181b4;
}

.input-icon-school svg {
    display: block;
    width: 19px;
    height: 19px;
}

.input-wrap input {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 13px 56px 13px 50px;
    border: 1px solid rgba(106, 72, 86, 0.16);
    border-radius: 14px;
    outline: none;
    background: #fffaf8;
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-wrap input::placeholder {
    color: #b9a7ae;
}

.input-wrap input:hover {
    border-color: rgba(217, 88, 93, 0.28);
    background: #fff;
}

.input-wrap input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(233, 109, 112, 0.11);
}

.input-wrap input[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(217, 82, 96, 0.09);
}

.field-hint {
    color: var(--muted);
    font-size: 0.64rem;
}

.field-error {
    min-height: 0;
    color: var(--danger);
    font-size: 0.66rem;
}

.field-error:empty {
    display: none;
}

.password-toggle {
    position: absolute;
    right: 10px;
    z-index: 2;
    min-width: 42px;
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}

.password-toggle:hover {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.login-button {
    display: flex;
    width: 100%;
    min-height: 54px;
    margin-top: 4px;
    padding: 13px 18px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 13px 25px rgba(217, 88, 93, 0.23);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.login-button:hover {
    background: var(--accent-strong);
    box-shadow: 0 17px 30px rgba(217, 88, 93, 0.28);
    transform: translateY(-2px);
}

.login-button:active {
    transform: translateY(0) scale(0.99);
}

.login-button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.login-button:focus-visible,
.password-toggle:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(217, 88, 93, 0.45);
    outline-offset: 3px;
}

.login-status {
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 10px;
    color: var(--text-soft);
    font-size: 0.72rem;
    text-align: center;
}

.login-status:not(:empty) {
    min-height: 39px;
    padding: 10px 12px;
    background: #f4f1fb;
    color: #6d55a5;
}

.account-notice {
    display: flex;
    gap: 10px;
    margin-top: 21px;
    padding: 13px 14px;
    border: 1px solid rgba(105, 169, 214, 0.18);
    border-radius: 13px;
    background: #f1f8fd;
}

.notice-icon {
    display: grid;
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-family: serif;
    font-size: 0.74rem;
    font-weight: 700;
}

.account-notice p {
    margin: 0;
    color: #597180;
    font-size: 0.68rem;
    line-height: 1.55;
}

.account-notice strong {
    display: block;
    margin-bottom: 2px;
    color: #467896;
}

.login-help {
    align-self: center;
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
}

.login-footer {
    display: flex;
    padding: 18px 6px 0;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

@media (max-width: 1040px) {
    .login-stage {
        min-height: 680px;
        grid-template-columns: minmax(0, 1fr) minmax(370px, 0.9fr);
    }

    .story-panel {
        padding: 46px 36px 30px;
    }

    .story-copy h1 {
        font-size: clamp(2.4rem, 5vw, 3.55rem);
    }

    .story-description {
        max-width: 430px;
    }

    .form-panel {
        padding: 48px 38px 34px;
    }
}

@media (max-width: 820px) {
    .login-shell {
        padding: 20px 20px 18px;
    }

    .login-stage {
        min-height: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
        border-radius: 25px;
    }

    .story-panel {
        min-height: 440px;
        padding: 36px 32px 26px;
    }

    .story-copy {
        max-width: 560px;
    }

    .story-description {
        max-width: 390px;
    }

    .login-hero video {
        object-position: 40% center;
        transform: scale(1.08) translate(13%, 8%);
    }

    .login-hero::after {
        background:
            linear-gradient(90deg, #fff1e9 0%, rgba(255, 243, 234, 0.94) 37%, rgba(255, 244, 234, 0.32) 66%, transparent 82%),
            linear-gradient(0deg, #fff7e9 2%, rgba(255, 247, 233, 0.15) 45%, transparent 62%);
    }

    .service-track {
        width: min(560px, 100%);
    }

    .hero-chip {
        display: none;
    }

    .form-panel {
        width: 100%;
        min-width: 0;
        padding: 42px 9vw 38px;
        border-top: 1px solid rgba(106, 72, 86, 0.1);
        border-left: 0;
    }

    .login-form,
    .field-group,
    .input-wrap {
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .login-shell {
        padding: 16px 12px;
    }

    .login-stage {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        align-self: center;
    }

    .login-stage {
        border-radius: 21px;
    }

    .story-panel {
        min-height: 390px;
        padding: 27px 22px 20px;
    }

    .story-panel::after,
    .service-pill {
        display: none;
    }

    .eyebrow {
        margin-top: 0;
    }

    .story-copy h1 {
        font-size: clamp(2.1rem, 10vw, 2.8rem);
    }

    .story-description {
        max-width: 83%;
        margin-top: 14px;
        font-size: 0.82rem;
        line-height: 1.65;
    }

    .login-hero video {
        object-position: 43% center;
        transform: scale(1.12) translate(20%, 12%);
    }

    .service-track {
        gap: 8px;
        grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
        padding: 13px;
    }

    .service-track > div {
        min-width: 0;
    }

    .service-track > div:last-child {
        justify-content: flex-end;
    }

    .service-track div > span:last-child {
        min-width: 0;
    }

    .track-icon {
        width: 34px;
        height: 34px;
    }

    .service-track small {
        display: none;
    }

    .service-track strong {
        overflow: hidden;
        font-size: 0.62rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .form-panel {
        max-width: 100%;
        overflow: hidden;
        padding: 35px 22px 30px;
    }

    .form-heading h2 {
        font-size: clamp(1.25rem, 6vw, 1.55rem);
    }

    .login-form {
        margin-top: 26px;
    }

    .field-label-row > span {
        display: none;
    }

    .login-footer {
        justify-content: center;
    }

    .login-footer span:last-child {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .login-hero video {
        display: none;
    }

    .login-hero {
        background: url("assets/robot-mascot-typing-background-16x9.png") center / cover no-repeat;
    }
}
