/**
 * Auth pages (login, register, password) — aligned with client-dashboard-trial theme
 */
:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
    --black: #000000;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html.auth-page,
body.auth-page {
    margin: 0;
    min-height: 100vh;
}

body.auth-page {
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--secondary-bg);
    -webkit-font-smoothing: antialiased;
}

/* ----- Split layout (wide) ----- */
.auth-page .auth-container.auth-split-layout {
    max-width: none;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    min-height: 100vh;
}

.auth-page .auth-split-form {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    background: var(--primary-bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 2rem clamp(1.25rem, 4vw, 3rem);
    box-shadow: var(--shadow-sm);
}

.auth-page .auth-split-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.auth-page .auth-split-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.auth-page .auth-split-logo-img {
    height: 44px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

/* Language switch — same idea as trial topbar */
.auth-page .auth-lang.trial-lang-switcher {
    flex-shrink: 0;
}

.auth-page .auth-lang .trial-lang-switch-track {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    gap: 4px;
}

.auth-page .auth-lang .trial-lang-switch-option {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.auth-page .auth-lang .trial-lang-switch-option:hover:not(.is-active) {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
}

.auth-page .auth-lang .trial-lang-switch-option.is-active {
    background: var(--black);
    color: var(--primary-bg);
}

.auth-page .auth-split-form-body {
    flex: 1;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.auth-page .auth-split-form-body > h2,
.auth-page .auth-split-form-body h2.auth-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: start;
}

html[dir='rtl'] .auth-page .auth-split-form-body > h2,
html[dir='rtl'] .auth-page .auth-split-form-body h2.auth-form-title {
    text-align: right;
}

.auth-page .auth-split-form-body .form-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    font-size: 0.95rem;
    text-align: start;
}

html[dir='rtl'] .auth-page .auth-split-form-body .form-subtitle {
    text-align: right;
}

/* ----- Visual column (same hero image as legacy auth: images/auth-visual.png) ----- */
.auth-page .auth-split-visual {
    flex: 0 0 40%;
    max-width: 520px;
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background-color: var(--secondary-bg);
    background-image: var(--auth-visual-url);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-inline-start: 1px solid var(--border-color);
    overflow: hidden;
}

/* ----- Forms ----- */
.auth-page .form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
}

.auth-page .form-control {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 0.7rem 1rem;
    font-size: 1rem;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-page .form-control:focus {
    border-color: var(--black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
    outline: none;
}

.auth-page .form-control::placeholder {
    color: #adb5bd;
}

.auth-page .input-group .form-control {
    border-radius: 10px;
}

.auth-page .input-group .btn {
    border: 1px solid var(--border-color);
    background: var(--secondary-bg);
    color: var(--text-primary);
    padding: 0 0.85rem;
}

.auth-page .input-group .btn:hover {
    background: #e9ecef;
}

.auth-page .input-group .btn svg {
    width: 18px;
    height: 18px;
}

/* Primary button */
.auth-page .btn-primary {
    background: var(--black);
    color: var(--primary-bg);
    border: 1px solid var(--black);
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-page .btn-primary:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: var(--primary-bg);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.auth-page .btn-primary:disabled {
    opacity: 0.65;
    transform: none;
}

.auth-page .auth-link-primary {
    color: var(--black);
    font-weight: 600;
    text-decoration: none;
}

.auth-page .auth-link-primary:hover {
    text-decoration: underline;
    color: #333;
}

/* Alerts — trial-like */
.auth-page .alert {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.auth-page .alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.auth-page .alert-danger,
.auth-page .alert-warning {
    border-width: 1px;
}

.auth-page .alert .btn-close {
    padding: 0.6rem;
}

/* Checkbox */
.auth-page .form-check-input:checked {
    background-color: var(--black);
    border-color: var(--black);
}

.auth-page .form-check-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ----- Compact card layout (non-wide) ----- */
.auth-page .auth-container:not(.auth-split-layout) {
    width: 100%;
    max-width: 460px;
    margin: auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-page .auth-card {
    width: 100%;
    background: var(--primary-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.auth-page .auth-header {
    background: var(--black);
    color: var(--primary-bg);
    padding: 2rem 1.75rem;
    text-align: center;
}

.auth-page .auth-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--primary-bg);
}

.auth-page .auth-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.auth-page .auth-body {
    padding: 2rem 1.75rem;
}

.auth-page .auth-footer {
    text-align: center;
    padding: 1.25rem 1.75rem;
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-page .auth-footer a {
    color: var(--black);
    font-weight: 600;
    text-decoration: none;
}

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

/* Responsive */
@media (max-width: 991.98px) {
    .auth-page .auth-container.auth-split-layout {
        flex-direction: column;
    }

    .auth-page .auth-split-visual {
        order: -1;
        min-height: auto;
        max-width: none;
        flex: none;
        padding: 2rem 1.5rem;
        border-inline-start: none;
        border-bottom: 1px solid var(--border-color);
    }

    .auth-page .auth-split-form {
        min-height: auto;
    }
}
