* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #0a0a0f url('assets/bg2.PNG') no-repeat center center fixed;
    background-size: cover;
    color: #fff;
    overflow-x: hidden;
}

.auth-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 215, 0, 0.08) 0%, transparent 55%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(10, 8, 4, 0.88) 100%);
    pointer-events: none;
}

.auth-page {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(165deg, rgba(26, 26, 26, 0.96) 0%, rgba(18, 18, 24, 0.98) 100%);
    border: 2px solid #ffd700;
    border-radius: 18px;
    padding: 28px 24px 24px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.65),
        0 0 40px rgba(255, 215, 0, 0.12),
        inset 0 1px 0 rgba(255, 215, 0, 0.15);
}

.auth-card::before {
    content: '';
    display: block;
    height: 3px;
    margin: -28px -24px 20px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, transparent, #ffd700, #ffed4e, #ffd700, transparent);
}

.auth-brand {
    text-align: center;
    margin-bottom: 22px;
}

.auth-logo {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffd700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.25);
    margin-bottom: 12px;
}

.auth-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.auth-subtitle {
    margin-top: 6px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-field {
    position: relative;
}

.auth-field i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffd700;
    font-size: 1rem;
    pointer-events: none;
}

.auth-field input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    border: 1.5px solid rgba(255, 215, 0, 0.35);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.auth-field input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.auth-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    color: #1a1400;
    box-shadow: 0 6px 20px rgba(255, 179, 0, 0.35);
}

.auth-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 179, 0, 0.45);
}

.auth-btn-google {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-btn-google:hover:not(:disabled) {
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.08);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 215, 0, 0.2);
}

.auth-switch {
    text-align: center;
    margin-top: 4px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.6);
}

.auth-switch a {
    color: #ffd700;
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-loading {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    background: rgba(0, 0, 0, 0.82);
}

.auth-loading.show {
    display: flex;
}

.auth-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 215, 0, 0.25);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: auth-spin 0.9s linear infinite;
}

.auth-loading-text {
    color: #ffd700;
    font-weight: 600;
}

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

.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-modal.show {
    display: flex;
}

.auth-phone-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.auth-field-code {
    flex: 0 0 118px;
    display: flex;
    align-items: center;
    padding: 0 26px 0 12px;
    border: 1.5px solid rgba(255, 215, 0, 0.35);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field-code:focus-within {
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

.auth-field-code::after {
    content: '';
    position: absolute;
    right: 13px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -5px;
    border-right: 2px solid #ffd700;
    border-bottom: 2px solid #ffd700;
    transform: rotate(45deg);
    pointer-events: none;
}

.auth-field-code select {
    width: 100%;
    padding: 13px 0;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 0.92rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.auth-field-code select option {
    color: #111;
    background: #fff;
}

.auth-field-phone {
    flex: 1;
    min-width: 0;
}

.auth-favorites {
    border: 1px solid rgba(255, 215, 0, 0.28);
    border-radius: 10px;
    padding: 10px 12px 12px;
    margin: 0 0 4px;
    background: rgba(0, 0, 0, 0.25);
}

.auth-favorites legend {
    color: #ffd700;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0 4px;
}

.auth-favorites legend span {
    color: #888;
    font-weight: 400;
}

.auth-favorites-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-top: 6px;
}

.auth-favorites-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
}

.auth-favorites-grid input {
    width: 16px;
    height: 16px;
    accent-color: #ffd700;
    flex-shrink: 0;
}

.auth-modal-box {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(165deg, #1a1f2e, #12151f);
    border: 2px solid #ffd700;
    border-radius: 12px;
    padding: 22px 20px 18px;
    box-shadow: 0 0 24px rgba(255, 215, 0, 0.15);
    position: relative;
}

.auth-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #ffd700;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.auth-modal-title {
    color: #ffd700;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.auth-modal-msg {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    line-height: 1.45;
}

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

    .auth-card::before {
        margin: -22px -18px 18px;
    }

    .auth-title {
        font-size: 1.45rem;
    }

    .auth-logo {
        width: 72px;
        height: 72px;
    }
}
