/* auth.css - Modern Auth Layout integrated with Carpoint Theme Variables */

body.cp-auth-page {
    margin: 0;
    padding: 0;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: 'Onest', sans-serif;
    min-height: 100vh;
}

/* Split Screen Layout Wrapper */
.cp-auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.cp-auth-banner {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-tertiary);
}

.cp-auth-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.cp-auth-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background-color: var(--bg-primary);
    box-sizing: border-box;
}

.cp-auth-content {
    width: 100%;
    margin: 0 auto;
    max-width: 440px;
}

/* Top Navigation Bar (Logo & Language Selector) */
.cp-auth-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.cp-auth-logo {
    height: 38px;
    width: auto;
}

/* Language selector: same look as the cabinet topbar (LV / EN / RU) */
.language-selector {
    position: relative;
    user-select: none;
    display: inline-block;
}

.language-selector-selected {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 12px;
    color: #d1d5db;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease;
}

.language-selector-selected:hover,
.language-selector-selected[aria-expanded="true"] {
    color: #ffffff;
    border-color: #3a3a3a;
}

.language-selector-selected svg {
    color: #9ca3af;
    transition: transform .2s ease;
}

.language-selector-selected[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.language-selector-options {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 96px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
    z-index: 50;
    transform-origin: top right;
    animation: cpLangIn .15s ease-out;
}

.language-selector-options.closed {
    display: none;
}

@keyframes cpLangIn {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.language-selector-options a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: #d1d5db;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.language-selector-options a:hover {
    color: #ffffff;
    background: #262626;
}

.language-selector-options a.is-active {
    color: #dc2626;
    font-weight: 600;
}

/* Header Text */
.cp-auth-title {
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-primary);
    font-weight: 400;
    font-style: SemiBold;
    font-size: 64px;
    line-height: 100%;
    letter-spacing: 0%;
}

.cp-auth-subtitle {
    font-weight: 400;
    font-style: Regular;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0%;
}

/* Notification Toasts */
.cp-auth-toast {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    font-size: 0.875rem;
}

.cp-auth-toast p {
    margin: 0;
}

.cp-auth-toast-error {
    background-color: var(--status-error-bg);
    color: var(--status-error);
    border: 1px solid var(--status-error);
}

.cp-auth-toast-success {
    background-color: var(--status-success-bg);
    color: var(--status-success);
    border: 1px solid var(--status-success);
}

/* Form Controls */
.cp-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cp-auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cp-auth-label {
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-primary);
}

.cp-auth-input {
    width: 100%;
    height: 48px;
    padding: 0 var(--spacing-md);
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: all var(--transition-base);
}

.cp-auth-input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-red);
}

.cp-auth-input::placeholder {
    color: var(--text-dark);
}

/* Toggle Switch & Links Row */
.cp-auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.825rem;
}

.cp-auth-switch-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}

.cp-auth-switch-input {
    display: none;
}

.cp-auth-switch-slider {
    width: 36px;
    height: 20px;
    background-color: var(--bg-hover);
    border-radius: var(--radius-full);
    position: relative;
    transition: background-color var(--transition-base);
}

.cp-auth-switch-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: var(--text-primary);
    border-radius: 50%;
    transition: transform var(--transition-base);
}

.cp-auth-switch-input:checked+.cp-auth-switch-slider {
    background-color: var(--primary-color);
}

.cp-auth-switch-input:checked+.cp-auth-switch-slider::before {
    transform: translateX(16px);
}

.cp-auth-switch-text {
    color: var(--text-primary);
}

.cp-auth-link-forgot {
    color: var(--text-muted);
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.cp-auth-link-forgot:hover {
    color: var(--primary-color);
}

/* Buttons */
.cp-auth-btn-submit {
    height: 48px;
    width: 140px;
    background: var(--text-primary);
    color: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.cp-auth-btn-submit:hover {
    background: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cp-auth-btn-test {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.825rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.cp-auth-btn-test:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

/* Footer Links */
.cp-auth-footer {
    margin-top: 2.5rem;
    font-size: 0.825rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.4rem;
}

.cp-auth-link-register {
    color: var(--text-primary);
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.cp-auth-link-register:hover {
    color: var(--primary-color);
}

/* Responsive Breakpoint */
@media (max-width: 992px) {
    .cp-auth-wrapper {
        flex-direction: column;
    }

    .cp-auth-banner {
        height: 240px;
        flex: none;
    }

    .cp-auth-panel {
        padding: 2.5rem 1.5rem;
    }
}
/* ==========================================================================
   Phone / tablet (≤992px): form first.
   Order: logo + language → short title → form → full-width submit → sign-up link.
   The photo is decorative and pushed the form below the fold, so it is hidden here.
   ========================================================================== */
@media (max-width: 992px) {
    .cp-auth-wrapper {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .cp-auth-banner {
        display: none;
    }

    .cp-auth-panel {
        flex: 1;
        align-items: flex-start;
        padding: 20px 20px 32px;
    }

    .cp-auth-content {
        max-width: 480px;
        display: flex;
        flex-direction: column;
        min-height: calc(100dvh - 52px);
    }

    .cp-auth-top-bar {
        margin-bottom: 40px;
    }

    .cp-auth-logo {
        height: 32px;
    }

    .cp-auth-title {
        font-size: 40px;
        line-height: 105%;
        margin-bottom: 12px;
    }

    .cp-auth-subtitle {
        font-size: 15px;
        margin: 0 0 28px;
        color: var(--text-muted, #a1a1aa);
    }

    .cp-auth-form {
        gap: 1rem;
    }

    .cp-auth-input {
        height: 52px;
        font-size: 16px; /* 16px stops iOS from zooming into the field */
    }

    .cp-auth-options {
        flex-wrap: wrap;
        gap: 12px 16px;
        margin-top: 4px;
    }

    .cp-auth-btn-submit {
        width: 100%;
        height: 52px;
        margin-top: 8px;
        font-size: 1rem;
    }

    .cp-auth-footer {
        margin-top: auto;
        padding-top: 32px;
        justify-content: center;
        flex-wrap: wrap;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .cp-auth-title {
        font-size: 34px;
    }
}
