/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Определение CSS-переменных */
:root {
  --mainFont: 'Onest', Arial, sans-serif;
  --bgActionPrimary: #005bff;
  --bgActionSecondary: rgba(0, 150, 255, 0.078);
  --bgSecondary: #fff;
  --textPrimary: #001a34;
  --textSecondary: rgba(0, 26, 52, 0.6);
  --textTertiary: rgba(0, 26, 52, 0.4);
  --textAction: #005bff;
  --textLightKey: #fff;
  --graphicTertiary: rgba(0, 26, 52, 0.4);
  --graphicQuaternary: rgba(0, 26, 52, 0.2);
  --layerFloor1: #fff;
  --layerOverlayDimming: rgba(3, 8, 13, 0.24);
  --boxShadow: 0 4px 16px 1px rgba(0, 26, 52, 0.16);
  --textFresh: #00b8b8; /* Бирюзовый цвет */
}

/* Подключение шрифта */
@font-face {
    font-family: 'Onest';
    font-weight: 100 900;
    font-display: swap;
    src: url('https://st.ozone.ru/s3/ozon-fonts/onest.woff2') format('woff2');
}

body {
    font-family: var(--mainFont);
    background-color: #fff;
    color: var(--textPrimary);
    font-size: 15px;
    line-height: 1.15;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

.layout-page {
    min-height: 100vh;
    position: relative;
}

.block-vertical {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.block-vertical.page {
    min-height: auto;
}

.ozon-id-page-anonymous {
    background-position: 100% 0;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 100vh;
    width: 100%;
}

.page-content-wrapper {
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 1472px;
    min-height: 100vh;
    position: relative;
    box-sizing: border-box;
}

.content-card {
    background-color: var(--layerFloor1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    margin: 110px 0;
    max-width: 416px;
    min-width: 280px;
    padding: 32px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 24px;
}

.logo-container {
    border-radius: 12px;
    height: 30px;
    margin-bottom: 32px;
    width: 130px;
}

.logo {
    object-fit: contain;
    width: 100%;
}

.auth-widget-content {
    box-sizing: border-box;
    color: var(--textPrimary);
    margin: 0 auto;
    min-height: 250px;
    text-align: left;
}

.auth-container {
    width: 100%;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 28px;
    margin-bottom: 8px;
    color: var(--textPrimary);
}

.auth-description {
    font-size: 16px;
    letter-spacing: 0.2px;
    line-height: 24px;
    margin-bottom: 28px;
    color: var(--textPrimary);
}

/* ======= ПОЛЕ ВВОДА ТЕЛЕФОНА ======= */
.phone-input-wrapper {
    margin-bottom: 20px;
    position: relative;
}

.phone-input-container {
    display: flex;
    position: relative;
}

.country-selector {
    position: absolute;
    left: 12px;
    top: 6px;
    z-index: 10;
    cursor: pointer;
}

.country-display {
    background-color: rgba(14, 50, 103, 0.04);
    border: 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 8px 0 6px;
    transition: background-color 0.2s;
    gap: 6px;
}

.country-display:hover {
    background-color: rgba(14, 50, 103, 0.08);
}

.country-flag-img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.country-code {
    font-family: var(--mainFont);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--textPrimary);
}

.dropdown-arrow {
    color: var(--textPrimary);
    transition: transform 0.2s;
    width: 16px;
    height: 16px;
}

.country-dropdown {
    position: absolute;
    left: 12px;
    top: 58px;
    width: 320px;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: var(--boxShadow);
    z-index: 1000;
    display: none;
}

.country-dropdown.show {
    display: block;
}

.country-dropdown-content {
    padding: 8px 0;
}

.country-option {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    gap: 12px;
}

.country-option:hover {
    background-color: rgba(14, 50, 103, 0.04);
}

.country-option.selected {
    background-color: rgba(0, 91, 255, 0.08);
}

.country-option-flag {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
}

.country-option-name {
    flex: 1;
    font-size: 14px;
    color: var(--textPrimary);
}

.country-option-code {
    font-size: 14px;
    color: var(--textSecondary);
    font-weight: 500;
}

.text-field {
    background-color: var(--layerFloor1);
    border: 2px solid var(--graphicQuaternary);
    border-radius: 6px;
    box-sizing: border-box;
    color: var(--textPrimary);
    display: flex;
    overflow: hidden;
    position: relative;
    width: 100%;
    transition: border-color 0.2s;
}

.text-field:focus-within {
    border-color: var(--bgActionPrimary);
}

.text-field.error {
    border-color: #f53c14;
}

.text-field-content {
    display: flex;
    flex: 1;
    max-width: 100%;
    position: relative;
    padding-left: 94px;
}

.text-field-input {
    background-color: transparent;
    border: 0;
    box-sizing: border-box;
    caret-color: var(--bgActionPrimary);
    color: var(--textPrimary);
    font-family: var(--mainFont);
    font-size: 16px;
    line-height: 20px;
    margin: 0;
    outline: none;
    padding: 18px 9px 18px;
    text-align: inherit;
    vertical-align: top;
    width: 100%;
    height: 56px;
}

.text-field-input::placeholder {
    color: transparent;
}

.text-field-placeholder {
    color: var(--textTertiary);
    font-family: var(--mainFont);
    font-size: 16px;
    line-height: 20px;
    position: absolute;
    left: 100px;
    top: 18px;
    margin: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    opacity: 1;
    z-index: 1;
}

.text-field-input:focus ~ .text-field-placeholder {
    opacity: 1;
    transform: translateY(-10px) scale(0.75);
    color: var(--textSecondary);
}

.text-field-input.input-has-value ~ .text-field-placeholder {
    opacity: 0;
}

.phone-error {
    color: #f53c14;
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
}

/* ======= КНОПКИ ======= */
.button {
    -webkit-touch-callout: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    align-items: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    border-radius: 16px;
    box-sizing: border-box;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    font-family: var(--mainFont);
    font-size: inherit;
    font-weight: inherit;
    justify-content: center;
    margin: 0;
    overflow: hidden;
    padding: 10px 16px;
    position: relative;
    text-align: center;
    text-decoration: none;
    width: 100%;
    transition: opacity 0.2s, transform 0.1s;
}

.button:active {
    transform: scale(0.98);
}

.button-large {
    padding: 19px 24px;
}

.button .button-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

.button-primary {
    background-color: var(--bgActionPrimary);
    color: var(--textLightKey);
}

.button-primary:hover {
    background-color: #0050e0;
}

.button-primary:disabled {
    background-color: var(--graphicQuaternary);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ======= БИРЮЗОВЫЙ PILL ДЛЯ 6 ЦИФР ======= */
.ou5_34 {
    border: 2px solid var(--textFresh);
    border-radius: 48px;
    color: var(--textFresh);
    padding: 4px 12px;
    display: inline-block;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    background-color: transparent;
    line-height: 1.2;
}

/* Контейнер для примерного номера */
.example-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: flex-start;
    text-align: left;
}

/* Текст "Отвечать на звонок не нужно" */
.call-instruction {
    color: #707f8d;
    font-size: 15px;
    margin-bottom: 24px;
    text-align: left;
    line-height: 1.4;
}

/* ======= МОДАЛЬНОЕ ОКНО ======= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 15px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--layerFloor1);
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    padding: 32px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #001a34;
    text-align: center;
}

.modal-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #001a34;
    text-align: left;
}

.modal-content p {
    color: #707f8d;
    font-size: 15px;
    margin-bottom: 8px;
    text-align: left;
    line-height: 1.5;
}

.modal-content .link-button {
    background: none;
    border: none;
    color: #005bff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.modal-content .link-button:hover {
    text-decoration: underline;
}

/* Поля для ввода кода */
.code-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 25px 0 15px;
}

.code-digit {
    width: 45px;
    height: 55px;
    border: 2px solid #d2d9df;
    border-radius: 8px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    color: #001a34;
    background: white;
    transition: border-color 0.2s;
}

.code-digit:focus {
    outline: none;
    border-color: #005bff;
}

.code-digit:disabled {
    background-color: #f5f5f5;
    color: #999;
}

/* Индикатор загрузки */
.loading-container {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.windows-loader {
    width: 60px;
    height: 60px;
    border: 3px solid var(--graphicQuaternary);
    border-top: 3px solid var(--bgActionPrimary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--textSecondary);
    font-size: 15px;
    margin-top: 20px;
    text-align: center;
}

.error-message {
    color: #f53c14;
    font-size: 13px;
    margin-top: 10px;
    display: none;
    text-align: center;
}

/* Блок с номером телефона */
#phoneDisplay {
    background-color: #f2f5f9;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0 10px;
}

#phoneDisplay div {
    font-size: 16px;
    font-weight: 500;
    color: #001a34;
    margin-bottom: 8px;
}

#phoneDisplay .link-button {
    font-size: 14px;
}

/* ======= ФУТЕР ======= */
.footer-links {
    display: flex;
    gap: 32px;
    justify-content: center;
    position: absolute;
    bottom: 24px;
    right: 24px;
    text-align: right;
}

.footer-link {
    align-items: center;
    display: flex;
    height: 32px;
    color: var(--textPrimary);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
    cursor: pointer;
}

.footer-link:hover {
    color: var(--textAction);
}

/* ======= АДАПТИВНОСТЬ ======= */
@media (max-width: 768px) {
    body {
        background-color: var(--layerFloor1);
    }
    
    .ozon-id-page-anonymous {
        background-image: none !important;
        background-color: var(--layerFloor1);
        display: flex;
        align-items: flex-start;
        min-height: 100vh;
    }
    
    .page-content-wrapper {
        padding: 0;
        min-height: 100vh;
        align-items: stretch;
        width: 100%;
    }
    
    .content-card {
        margin: 0;
        max-width: 100%;
        min-width: 100%;
        padding: 20px 16px 30px;
        box-shadow: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }
    
    .logo-container {
        margin-bottom: 24px;
        margin-top: 10px;
    }
    
    .auth-title {
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .auth-description {
        font-size: 18px;
        line-height: 1.4;
        margin-bottom: 24px;
    }
    
    .phone-input-wrapper {
        margin-bottom: 16px;
    }
    
    .button-large {
        padding: 21px 24px;
        font-size: 16px;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
        position: static;
        margin-top: 30px;
        padding-top: 20px;
        border-top: 1px solid var(--graphicQuaternary);
        text-align: center;
    }
    
    .footer-link {
        margin: 0 8px 8px;
        font-size: 14px;
    }
    
    .country-dropdown {
        width: calc(100vw - 32px);
        left: 16px;
        right: 16px;
    }
    
    /* Модальное окно на мобильных */
    .modal-overlay {
        padding: 0;
    }
    
    .modal-content {
        border-radius: 0;
        max-width: 100%;
        height: 100%;
        max-height: 100vh;
        padding: 24px 20px;
        display: flex;
        flex-direction: column;
    }
    
    .modal-content h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .code-digit {
        width: 45px;
        height: 55px;
        font-size: 26px;
    }
    
    .code-inputs {
        gap: 8px;
        margin: 30px 0;
    }
    
    .windows-loader {
        width: 80px;
        height: 80px;
    }
    
    .loading-text {
        font-size: 16px;
    }
    
    #phoneDisplay {
        margin-top: auto;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .code-digit {
        width: 40px;
        height: 50px;
        font-size: 24px;
    }
    
    .code-inputs {
        gap: 6px;
    }
    
    .ou5_34 {
        font-size: 18px;
        padding: 3px 10px;
    }
    
    .content-card {
        padding: 45px 17px 25px;
    }
    
    .logo-container {
        width: 110px;
        margin-bottom: 20px;
    }
    
    .auth-title {
        font-size: 20px;
    }
    
    .button-large {
        padding: 19px 20px;
    }
}

@media (max-width: 360px) {
    .code-digit {
        width: 35px;
        height: 45px;
        font-size: 22px;
    }
    
    .code-inputs {
        gap: 4px;
    }
    
    .example-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .button-large {
        padding: 18px 16px;
    }
}

/* Анимации */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Стили для сообщений об ошибках */
.error-text {
    color: #f53c14;
    font-size: 12px;
    margin-top: 4px;
}

.success-text {
    color: #10c44c;
    font-size: 12px;
    margin-top: 4px;
}

/* Стили для ссылок */
.link-button {
    background: none;
    border: none;
    color: #005bff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.link-button:hover {
    text-decoration: underline;
}

/* Стили для разделителя */
.separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: #707f8d;
    font-size: 14px;
    margin: 20px 0;
}

.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--graphicQuaternary);
}

.separator::before {
    margin-right: 10px;
}

.separator::after {
    margin-left: 10px;
}