html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.app-header {
    background: #FFC300;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.header-logo {
    width: 135px;
    height: auto;
    display: block;
    margin-top: 12px;
}

.header-logo-text {
    display: none;
}

.header-icon {
    display: none;
}

.page-banner {
    width: 100%;
    max-width: 357px;
    height: 82px;
    margin: 16px auto;
    flex-shrink: 0;
    overflow: hidden;
    line-height: 0;
    border-radius: 8px;
}

.page-banner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.page-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 40px;
}

.section-title {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-label);
    padding: 20px var(--page-px) 14px;
}

.field {
    padding: 0 var(--page-px);
    margin-bottom: 14px;
}

.field-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    font-style: normal;
    letter-spacing: 0.06em;
    color: #fff;
    margin-bottom: 7px;
}

.required {
    color: var(--red);
    margin-left: 1px;
}

.field-input {
    width: 100%;
    height: var(--input-h);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-input);
    color: var(--text-primary);
    padding: 0 16px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    outline: none;
    transition:
        border-color var(--t-fast),
        background var(--t-fast);
    -webkit-appearance: none;
    appearance: none;
}

.field-input::placeholder {
    color: var(--text-placeholder);
}

.field-input:focus {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
}

.field-input.filled {
    border-color: var(--primary);
}

.field-input.error {
    border-color: var(--border-error);
}

.field-error {
    display: block;
    font-size: 11px;
    color: var(--red);
    margin-top: 5px;
    min-height: 14px;
    line-height: 1.3;
}

.pass-wrap {
    position: relative;
}

.pass-wrap .field-input {
    padding-right: 50px;
}

.eye-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-label);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--t-fast);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.eye-btn:hover {
    color: var(--text-primary);
}

.eye-btn svg {
    width: 20px;
    height: 20px;
}

.phone-wrap {
    display: flex;
    gap: 0;
}

.phone-prefix {
    display: flex;
    align-items: center;
    gap: 5px;
    height: var(--input-h);
    padding: 0 12px;
    background: var(--bg-prefix);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--r-input) 0 0 var(--r-input);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

.phone-prefix .flag {
    font-size: 18px;
    line-height: 1;
}

.phone-prefix .arrow {
    font-size: 10px;
    color: var(--text-label);
    margin-left: 2px;
}

.phone-wrap .field-input {
    border-radius: 0 var(--r-input) var(--r-input) 0;
    flex: 1;
}

.divider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 var(--page-px) 14px;
}

.divider-text {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--white);
    white-space: nowrap;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: #383838;
}

.form-divider {
    padding: 6px var(--page-px) 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-label);
}

.btn-submit {
    display: block;
    width: calc(100% - var(--page-px) * 2);
    margin: 24px var(--page-px) 0;
    height: var(--btn-h);
    background: var(--primary);
    color: #000000;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--r-btn);
    border: none;
    cursor: pointer;
    transition:
        background var(--t-fast),
        opacity var(--t-fast),
        transform var(--t-fast);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-submit:active:not(:disabled) {
    transform: scale(0.99);
}

.btn-submit:disabled {
    background: #464646;
    color: #C3C3C3;
    cursor: not-allowed;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 600ms linear infinite;
}

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

.terms-container {
    background: #2A2A2A;
    border-radius: 8px;
    padding: 16px;
    margin: 16px var(--page-px) 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.terms-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1.5px solid #555;
    flex-shrink: 0;
}

.terms-text {
    font-size: 14px;
    color: #999;
    line-height: 1.4;
    text-align: left;
    font-weight: 400;
}

.terms-text a {
    color: #999;
    text-decoration: underline;
}

.auth-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 var(--page-px) 20px;
}

.auth-pill {
    padding: 10px 20px;
    background: #2A2A2A;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.auth-pill.active {
    background: var(--primary);
    color: #000;
    font-weight: 600;
}

.footer-link {
    text-align: center;
    padding: 20px var(--page-px) 0;
    font-size: 14px;
    color: var(--text-label);
}

.footer-link a {
    color: var(--primary);
    font-weight: 600;
}

.error-banner {
    display: none;
    align-items: flex-start;
    gap: 8px;
    margin: 0 var(--page-px) 4px;
    padding: 10px 14px;
    background: rgba(220, 26, 52, 0.1);
    border: 1px solid rgba(220, 26, 52, 0.3);
    border-radius: var(--r-input);
    font-size: 13px;
    color: #FF5B6B;
    line-height: 1.4;
}

.error-banner.visible {
    display: flex;
}

.error-banner svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base);
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: #2E2E2E;
    border: 1px solid #3A3A3A;
    border-radius: 16px;
    padding: 32px 24px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    transform: scale(0.9) translateY(16px);
    transition: transform var(--t-base);
}

.modal-backdrop.open .modal {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.modal-icon.success {
    background: rgba(243, 187, 4, 0.15);
    color: var(--primary);
}

.modal-icon.error {
    background: rgba(220, 26, 52, 0.12);
    color: var(--red);
}

.modal-icon svg {
    width: 30px;
    height: 30px;
}

.modal-title {
    font-family: var(--font-brand);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--white);
}

.modal-message {
    font-size: 14px;
    color: var(--text-label);
    line-height: 1.5;
    margin-bottom: 20px;
}

.modal-btn {
    width: 100%;
    height: 48px;
    border-radius: var(--r-btn);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: background var(--t-fast);
}

.modal-btn.primary {
    background: var(--primary);
    color: #000;
}

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

@media (min-width: 480px) {
    .page-main {
        max-width: 440px;
        width: 100%;
        margin: 0 auto;
    }

    .page-banner {
        max-width: 440px;
        margin: 16px auto;
    }

    .app-header {
        max-width: 100%;
        margin: 0;
        background: var(--bg-header);
    }

    body {
        background: #1A1A1A;
    }
}

.btn-submit.secondary {
    background: #444444;
    color: #FFFFFF;
}

.btn-submit.secondary:hover:not(:disabled) {
    background: #555555;
}

.home-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 var(--page-px);
    text-align: center;
}

.home-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
}

.wifi-icon-container {
    margin-top: auto;
    margin-bottom: 24px;
}

.wifi-icon {
    width: 100px;
    height: 100px;
    color: var(--primary);
}

.home-description {
    font-size: 16px;
    color: #999;
    line-height: 1.4;
    max-width: 280px;
    margin: 0 auto 40px;
}

.home-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: auto;
}

.home-actions .btn-submit {
    width: 100%;
    margin: 0;
    text-decoration: none;
}

.home-divider {
    width: 100%;
    height: 1px;
    background: #353535;
    margin-top: 30px;
}

.home-footer-terms {
    width: 100%;
    padding-bottom: 30px;
}

.shield-icon {
    width: 18px;
    height: 18px;
    color: #999;
    flex-shrink: 0;
}

.home-footer-terms .terms-container {
    background: #2A2A2A;
    border-radius: 14px;
    padding: 16px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-footer-terms .terms-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.redirect-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 var(--page-px);
}

.redirect-title {
    font-family: var(--font-body);
    font-size: 32px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.redirect-title::after {
    content: '';
    display: inline-block;
    width: 24px;
    text-align: left;
    margin-left: 2px;
    animation: redirect-dots 1.5s step-start infinite;
}

@keyframes redirect-dots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }
}

.redirect-subtext {
    font-size: 16px;
    font-weight: 400;
    color: #AAAAAA;
    margin-bottom: 30px;
}

.redirect-actions {
    width: 100%;
    max-width: 335px;
}

.modal-icon.error {
    color: var(--red);
    border-color: var(--red);
}

.modal-btn.error {
    background: var(--red);
    color: #fff;
    border: none;
}