@font-face {
    font-family: 'DM Sans';
    src: url('fonts/DMSans.ttf') format('truetype-variations');
    font-weight: 100 1000;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Source Serif 4';
    src: url('fonts/SourceSerif4.ttf') format('truetype-variations');
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --sn-gradient: linear-gradient(135deg, #0F7ADE 0%, #50CDF9 100%);
    --sn-red: #DD4B6B;
    --sn-red-tint: #FCE7ED;
    --sn-gray-20: #F5F5F7;
    --sn-gray-80: #99ACC6;
    --fg-1: #2C3E50;
    --fg-2: #5C6C80;
    --fg-3: #737F9B;
    --fg-4: #8C98A8;
    --fg-link: #0F7ADE;
    --accent: #0F7ADE;
    --accent-hover: #0B68C0;
    --accent-press: #095AA8;
    --border-1: #D8E0EC;
    --shadow-xl: 0 24px 56px rgba(44, 62, 80, 0.16);
    --shadow-brand: 0 10px 30px rgba(15, 122, 222, 0.22);
    --font-serif: 'Source Serif 4', 'Iowan Old Style', 'Georgia', 'Times New Roman', serif;
    --font-sans: 'DM Sans', 'Segoe UI', 'Helvetica Neue', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: #EEF5FD;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--fg-link); text-decoration: none; }

img {
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

#setup_button { display: none; }

@keyframes sn-spin { to { transform: rotate(360deg); } }

.sn-login {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #F4F8FD 0%, #E7F3FE 100%);
    font-family: var(--font-sans);
    color: var(--fg-1);
    letter-spacing: -0.02em;
}

.sn-ondas {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}
.sn-ondas img {
    position: absolute;
    left: 50%;
    top: calc(50% - 140px);
    width: max(1500px, 120%);
    height: auto;
    transform: translate(-50%, -50%) rotate(-24deg);
    opacity: .8;
    user-select: none;
}

.sn-main {
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 90px 24px 12px;
}

.sn-card {
    width: 100%;
    max-width: 880px;
    display: flex;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, .5);
    -webkit-backdrop-filter: blur(6px) saturate(140%);
    backdrop-filter: blur(6px) saturate(140%);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .85);
    box-shadow: var(--shadow-xl);
}

.sn-hero {
    flex: 1 1 340px;
    min-height: 320px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.sn-hero-inner {
    position: absolute;
    inset: 0;
    padding: 32px 36px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
}
.sn-hero-inner img {
    display: block;
    width: 100%;
    max-width: 340px;
    height: auto;
    min-height: 0;
    flex: 0 1 auto;
    object-fit: contain;
}
.sn-hero-inner h2 {
    margin: 0;
    position: relative;
    left: 12px;
    max-width: 340px;
    text-align: center;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 24px;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--fg-1);
    text-wrap: balance;
}
.sn-text-gradient {
    background: var(--sn-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sn-form-side {
    flex: 1 1 340px;
    min-height: 540px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 91px 36px 40px;
}
.sn-form-wrap {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.sn-logo {
    height: 31px;
    width: 142px;
    display: block;
    align-self: center;
}

.sn-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sn-form h1 {
    margin: 0;
    text-align: center;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 26px;
    line-height: 32px;
    letter-spacing: -0.015em;
    color: var(--fg-1);
}

.sn-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--sn-red-tint);
    color: #A23048;
    font-size: 13px;
    line-height: 18px;
}
.sn-alert svg { flex: none; margin-top: 1px; }

.sn-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sn-field label {
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    color: var(--fg-1);
}
.sn-input-wrap { position: relative; }
.sn-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border-1);
    border-radius: 10px;
    background: #fff;
    font: 400 14px/1 var(--font-sans);
    letter-spacing: -0.01em;
    color: var(--fg-1);
    outline: none;
    transition: border-color 120ms, box-shadow 120ms;
}
.sn-input::placeholder { color: var(--fg-4); }
.sn-input::-ms-reveal, .sn-input::-ms-clear { display: none; }
.sn-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 122, 222, .18);
}
.sn-input.is-invalid {
    border-color: var(--sn-red);
    box-shadow: 0 0 0 3px rgba(221, 75, 107, .14);
}
.sn-input-pass { padding-right: 46px; }
.sn-field-error {
    font-size: 13px;
    line-height: 18px;
    color: #A23048;
}
.sn-caps {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 18px;
    color: #9A5A0C;
}
.sn-caps.is-on { display: flex; }

.sn-eye {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--fg-3);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 120ms, color 120ms;
}
.sn-eye:hover { background: var(--sn-gray-20); color: var(--fg-1); }
.sn-eye .sn-eye-off { display: none; }
.sn-eye.is-visible .sn-eye-on { display: none; }
.sn-eye.is-visible .sn-eye-off { display: block; }

.sn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: -4px;
}
.sn-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    font: 500 13px/18px var(--font-sans);
    letter-spacing: -0.01em;
    color: var(--fg-2);
    user-select: none;
}
.sn-check input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.sn-check-box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--sn-gray-80);
    background: #fff;
    display: grid;
    place-items: center;
    flex: none;
    color: #fff;
}
.sn-check-box svg { display: none; }
.sn-check input:checked + .sn-check-box {
    background: var(--accent);
    border-color: var(--accent);
}
.sn-check input:checked + .sn-check-box svg { display: block; }
.sn-check input:focus-visible + .sn-check-box {
    box-shadow: 0 0 0 3px rgba(15, 122, 222, .18);
}
.sn-link {
    font: 600 13px/18px var(--font-sans);
    letter-spacing: -0.01em;
    color: var(--fg-link);
}

.sn-btn {
    height: 44px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font: 600 15px/1 var(--font-sans);
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: var(--shadow-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 120ms, transform 120ms;
}
.sn-btn:hover { background: var(--accent-hover); }
.sn-btn:active { background: var(--accent-press); transform: scale(.98); }
.sn-btn:disabled { cursor: default; }
.sn-btn .sn-spinner {
    display: none;
    animation: sn-spin .8s linear infinite;
    flex: none;
}
.sn-btn.is-loading .sn-spinner { display: block; }

.sn-btn-outline {
    height: 44px;
    width: 100%;
    border: 1px solid var(--border-1);
    border-radius: 10px;
    background: #fff;
    color: var(--fg-1);
    font: 600 14px/1 var(--font-sans);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 120ms;
}
.sn-btn-outline:hover {
    background: var(--sn-gray-20);
    color: var(--fg-1);
    text-decoration: none;
}

.sn-stores {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sn-stores img { display: block; width: 125px; height: 36px; object-fit: fill; border-radius: 7px; }

.sn-footer {
    position: relative;
    z-index: 1;
    padding: 56px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    line-height: 18px;
    color: var(--fg-2);
    text-align: center;
    background: linear-gradient(0deg, #E7F3FE 0%, rgba(231, 243, 254, 0) 100%);
}
.sn-footer-links {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}
.sn-footer a { color: var(--fg-2); }
.sn-footer a:hover { color: var(--accent); }

@media (min-width: 728px) and (max-height: 800px) {
    .sn-main { padding: 24px 24px 12px; }
    .sn-form-side { min-height: 0; padding-top: 56px; }
    .sn-footer { padding-top: 24px; }
}

@media (max-width: 727px) {
    .sn-main { padding: 16px 12px 8px; align-items: flex-start; }
    .sn-card { max-width: 440px; }
    .sn-hero { min-height: 0; }
    .sn-hero-inner { position: static; padding: 20px 20px 0; gap: 12px; }
    .sn-hero-inner img { max-width: 140px; }
    .sn-hero-inner h2 { font-size: 18px; line-height: 1.15; left: 0; }
    .sn-form-side { min-height: 0; padding: 24px 20px 28px; }
    .sn-form-wrap { gap: 18px; }
    .sn-footer { padding: 24px 16px 16px; }
}

@media (max-width: 727px) and (max-height: 600px) {
    .sn-hero { display: none; }
}

.sn-form-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}
.sn-form-head p {
    margin: 0;
    font-size: 14px;
    line-height: 21px;
    color: var(--fg-2);
    text-wrap: pretty;
}

.sn-alert-success {
    background: #D8EFDF;
    color: #17733B;
}

.sn-back {
    align-self: center;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sn-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: #E7F3FE;
    color: var(--accent);
    display: grid;
    place-items: center;
}

@media (max-width: 360px) {
    .sn-stores { gap: 8px; }
    .sn-stores img { width: 114px; height: 33px; border-radius: 6px; }
}
