@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    --auth-green: #27d17f;
    --auth-green-hover: #22c273;
    --auth-green-soft: #e9f9f0;
    --auth-bg: #f3faf6;
    --auth-white: #ffffff;
    --auth-text: #15241c;
    --auth-muted: #6b7c73;
    --auth-line: #e4eee8;
    --auth-danger: #d64545;
    --auth-warn: #c27a12;
    --auth-radius: 16px;
    --auth-shadow: 0 12px 40px rgba(16, 35, 26, 0.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

.auth-body {
    font-family: Inter, system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(39, 209, 127, 0.18), transparent 55%),
        radial-gradient(900px 420px at 100% 0%, rgba(39, 209, 127, 0.12), transparent 50%),
        var(--auth-bg);
    color: var(--auth-text);
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--auth-white);
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    padding: 32px 28px;
}

.auth-card.wide {
    max-width: 560px;
}

.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.auth-brand img {
    max-width: 180px;
    height: auto;
}

.auth-title {
    margin: 0 0 6px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    margin: 0 0 24px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 0.925rem;
    line-height: 1.5;
}

.auth-alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.45;
}

.auth-alert ul {
    margin: 0;
    padding-left: 1.1rem;
}

.auth-alert.success {
    background: var(--auth-green-soft);
    border: 1px solid #bfead3;
    color: #147a4a;
}

.auth-alert.error {
    background: #fdeeee;
    border: 1px solid #f3c7c7;
    color: var(--auth-danger);
}

.auth-alert.warn {
    background: #fff6e8;
    border: 1px solid #f0d7a8;
    color: var(--auth-warn);
}

.auth-alert.info {
    background: var(--auth-green-soft);
    border: 1px solid #bfead3;
    color: #147a4a;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-field label .req {
    color: var(--auth-danger);
}

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

.auth-field .label-row label {
    margin: 0;
}

.auth-field input,
.auth-field select,
.auth-field textarea {
    width: 100%;
    border: 1px solid var(--auth-line);
    background: #fff;
    color: var(--auth-text);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-field input:focus,
.auth-field select:focus,
.auth-field textarea:focus {
    border-color: var(--auth-green);
    box-shadow: 0 0 0 3px rgba(39, 209, 127, 0.18);
}

.auth-field input[readonly] {
    background: #f7fbf8;
    color: var(--auth-muted);
}

.auth-hint {
    display: block;
    margin-top: 6px;
    color: var(--auth-muted);
    font-size: 0.78rem;
}

.auth-link {
    color: var(--auth-green);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.84rem;
}

.auth-link:hover {
    color: var(--auth-green-hover);
    text-decoration: underline;
}

.auth-password {
    display: flex;
    align-items: stretch;
}

.auth-password input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
}

.auth-password button {
    border: 1px solid var(--auth-line);
    border-left: 0;
    background: #f7fbf8;
    color: var(--auth-muted);
    border-radius: 0 12px 12px 0;
    padding: 0 14px;
    cursor: pointer;
    font: inherit;
}

.auth-password button:hover {
    color: var(--auth-green);
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    font-size: 0.875rem;
}

.auth-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-green);
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: var(--auth-green);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 0.98rem;
    padding: 13px 16px;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

.auth-btn:hover {
    background: var(--auth-green-hover);
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn.secondary {
    background: #fff;
    color: var(--auth-text);
    border: 1px solid var(--auth-line);
    font-weight: 600;
}

.auth-btn.secondary:hover {
    background: var(--auth-green-soft);
    border-color: #bfead3;
    color: #147a4a;
}

.auth-footer {
    margin-top: 18px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 0.84rem;
}

.auth-phone {
    position: relative;
}

.auth-phone-row {
    display: flex;
    align-items: stretch;
}

.auth-phone-toggle {
    min-width: 118px;
    border: 1px solid var(--auth-line);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    background: #f7fbf8;
    color: var(--auth-text);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0 12px;
    cursor: pointer;
    text-align: left;
}

.auth-phone-row input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.auth-phone-menu {
    display: none;
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    box-shadow: var(--auth-shadow);
    overflow: hidden;
}

.auth-phone-menu.is-open {
    display: block;
}

.auth-phone-menu-search {
    padding: 10px;
    border-bottom: 1px solid var(--auth-line);
}

.auth-phone-menu-search input {
    width: 100%;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    padding: 9px 12px;
    font: inherit;
}

.auth-phone-list {
    max-height: 220px;
    overflow-y: auto;
}

.auth-phone-list button {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 14px;
    font: inherit;
    font-size: 0.875rem;
    color: var(--auth-text);
    cursor: pointer;
}

.auth-phone-list button:hover {
    background: var(--auth-green-soft);
    color: #147a4a;
}

@media (max-width: 540px) {
    .auth-card {
        padding: 26px 18px;
    }
}

/* ---- Split login (sign-in) ---- */
.auth-body.split {
    background: #0f1412;
    color: #fff;
}

.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.auth-hero {
    position: relative;
    overflow: hidden;
    padding: 40px 48px 36px;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(900px 520px at 18% 100%, rgba(39, 209, 127, 0.28), transparent 55%),
        radial-gradient(700px 420px at 80% 10%, rgba(39, 209, 127, 0.08), transparent 50%),
        linear-gradient(165deg, #151b18 0%, #0f1412 48%, #0c1210 100%);
}

.auth-hero-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 56px;
}

.auth-hero-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.auth-hero-brand-text {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
}

.auth-hero-brand-text span {
    color: var(--auth-green);
}

.auth-hero-copy {
    max-width: 540px;
    position: relative;
    z-index: 2;
}

.auth-hero-copy h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: #fff;
}

.auth-hero-copy h1 em {
    font-style: normal;
    color: var(--auth-green);
}

.auth-hero-copy > p {
    margin: 0 0 34px;
    max-width: 460px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
    line-height: 1.6;
}

.auth-hero-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 18px;
}

.auth-hero-features li {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    align-items: start;
}

.auth-hero-features .icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--auth-green);
    background: rgba(39, 209, 127, 0.1);
    border: 1px solid rgba(39, 209, 127, 0.28);
}

.auth-hero-features strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.98rem;
    color: #fff;
}

.auth-hero-features span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.88rem;
    line-height: 1.45;
}

.auth-hero-visual {
    margin-top: auto;
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    padding-top: 28px;
}

.auth-hero-chart {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 42px;
    height: 140px;
    z-index: 1;
    pointer-events: none;
}

.auth-hero-coins {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.auth-hero-coins img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
    animation: auth-float 4.5s ease-in-out infinite;
}

.auth-hero-coins img:nth-child(2) {
    width: 92px;
    height: 92px;
    margin-bottom: 8px;
    animation-delay: 0.4s;
}

.auth-hero-coins img:nth-child(3) {
    width: 64px;
    height: 64px;
    animation-delay: 0.8s;
}

@keyframes auth-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.auth-form-pane {
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(700px 420px at 90% 0%, rgba(39, 209, 127, 0.08), transparent 55%),
        #eef5f1;
}

.auth-login-card {
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(12, 24, 18, 0.14);
    padding: 36px 40px 34px;
    color: var(--auth-text);
    position: relative;
}

.auth-lang {
    position: absolute;
    top: 22px;
    right: 22px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--auth-line);
    background: #f7fbf8;
    color: var(--auth-muted);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
}

.auth-login-card h2 {
    margin: 8px 0 8px;
    font-size: 2rem;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: var(--auth-text);
}

.auth-login-lead {
    margin: 0 0 26px;
    color: var(--auth-muted);
    font-size: 0.98rem;
    line-height: 1.55;
}

.auth-login-lead strong {
    color: var(--auth-green);
    font-weight: 700;
}

.auth-input {
    position: relative;
}

.auth-input .leading-icon,
.auth-input .trailing-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #8a9a91;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.auth-input .leading-icon { left: 14px; }

.auth-input .trailing-icon {
    right: 12px;
    pointer-events: auto;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.auth-input .trailing-icon:hover { color: var(--auth-green); }

.auth-input input {
    width: 100%;
    border: 1px solid #dde8e1;
    background: #fff;
    color: var(--auth-text);
    border-radius: 14px;
    padding: 14px 46px 14px 46px;
    font: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-input input:focus {
    border-color: var(--auth-green);
    box-shadow: 0 0 0 3px rgba(39, 209, 127, 0.16);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
}

.auth-btn.with-arrow {
    display: inline-flex;
    gap: 10px;
    margin-top: 4px;
}

.auth-btn.with-arrow .arrow {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    display: grid;
    place-items: center;
}

.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 8px 0 2px;
    color: #9aaba2;
    font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    background: #e4eee8;
}

.auth-social {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-social button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #dde8e1;
    background: #fff;
    color: var(--auth-text);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: default;
}

.auth-login-card .auth-footer {
    margin-top: 22px;
}

.auth-login-card.register {
    max-width: 620px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-form-grid .full {
    grid-column: 1 / -1;
}

.auth-login-card.register .auth-field select {
    width: 100%;
    border: 1px solid #dde8e1;
    background: #fff;
    color: var(--auth-text);
    border-radius: 14px;
    padding: 14px 14px;
    font: inherit;
    font-size: 0.95rem;
    outline: none;
}

.auth-login-card.register .auth-field select:focus {
    border-color: var(--auth-green);
    box-shadow: 0 0 0 3px rgba(39, 209, 127, 0.16);
}

.auth-login-card.register .auth-phone-toggle {
    border-radius: 14px 0 0 14px;
    border-color: #dde8e1;
    background: #f7fbf8;
}

.auth-login-card.register .auth-phone-row input {
    border-radius: 0 14px 14px 0;
    border-color: #dde8e1;
    padding: 14px;
}

@media (max-width: 640px) {
    .auth-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        padding: 28px 24px 20px;
        min-height: auto;
    }

    .auth-hero-brand { margin-bottom: 28px; }

    .auth-hero-visual {
        min-height: 150px;
        margin-top: 28px;
    }

    .auth-form-pane {
        padding: 18px 16px 28px;
        background: #eef5f1;
    }

    .auth-login-card {
        padding: 28px 22px 24px;
        border-radius: 22px;
    }

    .auth-lang { display: none; }
}
