* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-y: auto;
}

body {
    background: #f8fafc;
    height: 100%;
    position: relative;
}

/* ─── Контейнер и карточка ─────────────────────────────────────────────────── */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    margin: 68px auto 20px;
    display: block;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 30px;
    text-align: center;
    border: 1px solid #e2e8f0;
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 0 auto;
    position: relative;
}

.login-card h2 {
    font-size: 24px;
    color: #2d3748;
    margin-bottom: 20px;
    font-weight: 600;
}

.login-card p {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 15px;
}

/* ─── Поле ввода ────────────────────────────────────────────────────────────── */
.phone-input {
    position: relative;
    margin-bottom: 20px;
}

.country-code {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    font-size: 16px;
    pointer-events: none;
}

.phone-input input {
    width: 100%;
    height: 35px;
    padding: 0 12px 0 50px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.phone-input input:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
    outline: none;
}

.phone-input input::placeholder {
    color: #a0aec0;
}

/* ─── Основная кнопка ───────────────────────────────────────────────────────── */
.btn {
    height: 40px;
    width: 100%;
    padding: 0 30px;
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Roboto', Helvetica, sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin: 0 auto 20px;
    display: block;
}

.btn:hover {
    background: #2b6cb0;
    transform: translateY(-2px);
}

.btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

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

/* ─── Социальные кнопки ─────────────────────────────────────────────────────── */
.social-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Google */
.g_id_signin {
    width: 100% !important;
    overflow: hidden;
}

.g_id_signin > div {
    width: 100% !important;
}


.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 40px;
    margin: 0;
    padding: 0 16px;
    background-color: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.2s, box-shadow 0.2s;
}

.google-btn:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.google-btn .social-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Apple */
.apple-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 40px;
    margin: 0;
    padding: 0 16px;
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.2s;
}

.apple-btn:hover {
    background-color: #1a1a1a;
}

.apple-btn .social-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: invert(1);
}

/* ─── Мобильная версия (≤ 900px) ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .login-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
        position: relative;
        z-index: 1;
    }

    .login-card {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
        border: none;
        height: 83vh;
        margin: 0;
        position: static;
    }

    .login-card h2 {
        font-size: 18px;
        text-align: left;
        margin: 0 0 15px 10px;
    }

    .login-card p {
        font-size: 0.8rem;
        margin: 0 0 10px 10px;
        text-align: left;
    }

    .phone-input {
        margin-bottom: 15px;
    }

    .phone-input input {
        font-size: 16px;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0 15px;
        margin-bottom: 15px;
    }

    .social-buttons {
        gap: 10px;
    }

    .btn, .google-btn, .apple-btn {
        height: 36px;
    }

}

/* ─── Очень маленькие экраны (≤ 480px) ─────────────────────────────────────── */
@media (max-width: 480px) {
    .login-card {
        padding: 10px;
    }

    .login-card h2 {
        font-size: 16px;
        margin: 0 0 10px 5px;
    }

    .login-card p {
        font-size: 0.7rem;
        margin: 0 0 8px 5px;
    }

    .phone-input input,
    .btn {
        font-size: 16px;
    }

    .apple-btn .social-icon {
        width: 16px;
        height: 16px;
    }
}