/* ========================================
   AUTH PAGES - MOBILE FIRST
   ======================================== */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: var(--page-side-padding);
    padding-bottom: 2rem;
    padding-left: var(--page-side-padding);
}

.auth-page-long {
    align-items: flex-start;
}

.auth-panel-spacious {
    margin-top: 1.5rem;
}

.auth-panel {
    width: 100%;
    max-width: 520px;
}

.panel {
    background: rgba(0, 0, 0, 0.75);
    border-radius: 8px;
    padding: 1.25rem;
}

.user-title {
    margin: 0 0 1rem;
    font-size: 1.6rem;
    line-height: 1.2;
}

.user-subtitle {
    margin: 0 0 1.5rem;
    color: #b3b3b3;
    font-size: 0.95rem;
}

.user-form-stack {
    display: grid;
    gap: 1rem;
}

.user-inline-link {
    margin: 0;
    font-size: 0.9rem;
}

.user-link-row {
    margin-top: 1.5rem;
    color: #b3b3b3;
}

.auth-page a {
    color: var(--primary-red);
    text-decoration: none;
}

.auth-page a:hover,
.auth-page a:focus-visible {
    color: var(--primary-red-hover);
}

.form-message {
    min-height: 20px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-message:empty {
    display: none;
}

/* ========================================
   AUTH INPUTS
   ======================================== */

.auth-page input,
.account-page input {
    width: 100%;
    min-height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: var(--border-radius);
    outline: none;
    background: #333;
    color: #fff;
    font-size: 1rem;
}

.auth-page input:focus-visible,
.account-page input:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 2px;
}

.input-muted,
.input-muted:disabled {
    background: #262626;
    color: #8f8f8f;
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: not-allowed;
    opacity: 1;
}

.input-muted::placeholder {
    color: #777;
}

.auth-page select,
.account-page select {
    width: 100%;
    min-height: 44px;
    padding: 0 48px 0 20px;

    border: none;
    border-radius: var(--border-radius);
    outline: none;

    background-color: #333;
    color: #fff;

    font-family: inherit;
    font-size: 1rem;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image:
        linear-gradient(45deg, transparent 50%, #ffffff 50%),
        linear-gradient(135deg, #ffffff 50%, transparent 50%);
    background-position:
        calc(100% - 22px) 50%,
        calc(100% - 16px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.auth-page select:focus-visible,
.account-page select:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 2px;
}

.auth-page select option,
.account-page select option {
    background-color: #1f1f1f;
    color: #fff;
}

/* ========================================
   PASSWORD FIELD
   ======================================== */

.password-field {
    position: relative;
    width: 100%;
}

.password-field input {
    padding-right: 80px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    width: auto;
    height: auto;
    min-width: auto;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: none;
    color: var(--text-primary);
    transform: translateY(-50%);
}

/* ========================================
   AUTH BUTTONS
   ======================================== */

.btn-login {
    justify-content: center;
    min-height: 44px;
    background-color: var(--primary-red);
    color: #fff;
}

.btn-login:hover,
.btn-login:focus-visible {
    background-color: var(--primary-red-hover);
    color: #fff;
    transform: scale(1.05);
}

/* ========================================
   AUTH LANGUAGE SWITCH
   ======================================== */

.auth-language-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;

    min-width: 92px;
    height: 38px;
    padding: 0 1rem;

    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--border-radius);

    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);

    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    letter-spacing: 0.02em;

    transition:
        background-color var(--transition-speed),
        border-color var(--transition-speed),
        transform var(--transition-speed);
}

.auth-language-switch i {
    display: inline-block;
    color: currentColor;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.auth-language-switch span {
    display: inline-block;
    line-height: 1;
}

.auth-language-switch:hover,
.auth-language-switch:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.65);
    color: var(--text-primary);
    transform: scale(1.04);
}

/* ========================================
   ACCOUNT PAGE
   ======================================== */

.account-page {
    display: flex;
    justify-content: center;
    padding-right: var(--page-side-padding);
    padding-bottom: 2rem;
    padding-left: var(--page-side-padding);
}

.account-page-spacious {
    padding-top: 1.5rem;
}

.account-container {
    width: 100%;
    max-width: 720px;
}

.account-overview,
.account-section {
    margin-bottom: 1.5rem;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.account-avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    font-size: 1.45rem;
}

.account-title {
    margin-bottom: 0.35rem;
}

.account-subtitle {
    margin-bottom: 0;
}

.account-message {
    margin-bottom: 1rem;
}

.account-section-header {
    margin-bottom: 1.25rem;
}

.account-section-title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.2;
    font-weight: 600;
}

.account-section-description {
    margin: 0.35rem 0 0;
    color: #b3b3b3;
    font-size: 0.95rem;
}

.account-form {
    display: grid;
    gap: 1rem;
}

.account-field {
    display: grid;
    gap: 0.5rem;
}

.account-field label {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

.account-field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.account-help-text {
    color: #b3b3b3;
    font-size: 0.85rem;
}

.account-submit {
    width: 100%;
    justify-content: center;
}

.account-submit[data-state="dirty"] {
    background-color: var(--primary-red);
    color: #fff;
}

.account-submit[data-state="dirty"]:hover,
.account-submit[data-state="dirty"]:focus-visible {
    background-color: var(--primary-red-hover);
}

.account-section-danger {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ========================================
   TABLET - 768px+
   ======================================== */

@media screen and (min-width: 768px) {
    .auth-panel {
        max-width: 560px;
    }

    .panel {
        padding: 2rem;
    }

    .user-title {
        font-size: 2rem;
    }

    .user-subtitle {
        font-size: 1rem;
    }

    .auth-page input,
    .auth-page select,
    .account-page input,
    .account-page select,
    .btn-login {
        min-height: 48px;
        font-size: 1rem;
    }

    .account-container {
        max-width: 760px;
    }

    .account-section {
        padding: 2rem;
    }

    .account-title {
        font-size: 2.2rem;
    }

    .account-avatar {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        font-size: 1.65rem;
    }

    .account-field-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========================================
   LAPTOP - 1024px+
   ======================================== */

@media screen and (min-width: 1024px) {
    .auth-panel {
        max-width: 580px;
    }

    .panel {
        padding: 2.4rem;
    }

    .user-title {
        font-size: 2.2rem;
    }

    .auth-page input,
    .auth-page select,
    .account-page input,
    .account-page select,
    .btn-login {
        min-height: 50px;
    }

    .account-container {
        max-width: 820px;
    }

    .account-section {
        padding: 2.4rem;
    }
}

/* ========================================
   DESKTOP - 1440px+
   ======================================== */

@media screen and (min-width: 1440px) {
    .auth-panel {
        max-width: 620px;
    }

    .panel {
        padding: 2.6rem;
    }

    .user-title {
        font-size: 2.4rem;
    }

    .user-subtitle {
        font-size: 1.05rem;
    }
}

/* ========================================
   TV / VERY LARGE - 1920px+
   ======================================== */

@media screen and (min-width: 1920px) {
    .auth-panel {
        max-width: 720px;
    }

    .panel {
        padding: 3rem;
    }

    .user-title {
        font-size: 2.8rem;
    }

    .user-subtitle {
        font-size: 1.2rem;
    }

    .user-form-stack {
        gap: 1.2rem;
    }

    .auth-page input,
    .auth-page select,
    .account-page input,
    .account-page select,
    .btn-login {
        min-height: 58px;
        font-size: 1.1rem;
    }

    .password-toggle {
        font-size: 1.05rem;
    }

    .auth-language-switch {
        min-width: 120px;
        height: 52px;
        padding: 0 1.4rem;
        gap: 0.85rem;
        font-size: 1.15rem;
    }

    .auth-language-switch i {
        font-size: 1.25rem;
    }
}

/* ========================================
   SMALL MOBILE - 379px-
   ======================================== */

@media screen and (max-width: 379px) {
    .auth-page {
        padding-bottom: 1.5rem;
    }

    .panel {
        padding: 1rem;
    }

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

    .user-subtitle {
        font-size: 0.9rem;
    }

    .auth-page input,
    .auth-page select,
    .account-page input,
    .account-page select,
    .btn-login {
        min-height: 42px;
        font-size: 0.95rem;
    }

    .account-section {
        padding: 1rem;
    }

    .account-title {
        font-size: 1.55rem;
    }

    .account-avatar {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        font-size: 1.3rem;
}
}
