/* ==========================================================================
   Estanar Authentication Pages
   Bilingual RTL/LTR Support
   ========================================================================== */

/* CSS Variables */
:root {
    --auth-bg: #100047;
    --auth-card-bg: #1e1a4a;
    --auth-primary: #2246FF;
    --auth-primary-hover: #1a36cc;
    --auth-accent: #EFA621;
    --auth-text: #FFFFFF;
    --auth-text-muted: rgba(255, 255, 255, 0.7);
    --auth-input-bg: #FFFFFF;
    --auth-input-text: #333333;
    --auth-border: rgba(255, 255, 255, 0.1);
    --auth-error: #ef4444;
    --auth-success: #22c55e;
}

/* Hide default header/footer on auth pages */
body.page-template-page-login .site-header,
body.page-template-page-login .site-footer,
body.page-template-page-register .site-header,
body.page-template-page-register .site-footer,
body.page-template-page-forgot-password .site-header,
body.page-template-page-forgot-password .site-footer,
body.page-template-page-reset-password .site-header,
body.page-template-page-reset-password .site-footer {
    display: none !important;
}

body.page-template-page-login,
body.page-template-page-register,
body.page-template-page-forgot-password,
body.page-template-page-reset-password {
    background-color: var(--auth-bg);
}

body.page-template-page-login .site-main,
body.page-template-page-register .site-main,
body.page-template-page-forgot-password .site-main,
body.page-template-page-reset-password .site-main {
    padding: 0;
    margin: 0;
}

/* ==========================================================================
   Auth Page Layout
   ========================================================================== */

.auth-page {
    min-height: 100vh;
    background-color: var(--auth-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 500px;
    min-height: 600px;
    background-color: var(--auth-card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Form Side
   ========================================================================== */

.auth-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem;
    background-color: var(--auth-card-bg);
}

.auth-form-wrapper {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

/* Title */
.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--auth-accent);
    margin-bottom: 2rem;
    text-align: start;
}

/* ==========================================================================
   Image Side
   ========================================================================== */

.auth-image-side {
    flex: 1;
    display: none;
    position: relative;
    background: linear-gradient(135deg, rgba(34, 70, 255, 0.1) 0%, rgba(239, 166, 33, 0.1) 100%);
    padding: 2rem;
}

.auth-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: hidden;
}

.auth-image-side img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 500px;
}

@media (min-width: 992px) {
    .auth-image-side {
        display: flex;
    }
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--auth-text);
    text-align: start;
}

.form-group label .required {
    color: var(--auth-accent);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    border: 2px solid transparent;
    background-color: var(--auth-input-bg);
    color: var(--auth-input-text);
    font-size: 1rem;
    transition: all 0.2s ease;
    text-align: start;
}

.form-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(34, 70, 255, 0.2);
}

.form-input::placeholder {
    color: #999;
}

.form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8rem;
    color: var(--auth-text-muted);
}

/* Form Row - Two columns */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row-half {
    flex-direction: column;
}

.form-row-half .form-group {
    flex: 1;
}

/* Form Options Row */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--auth-text-muted);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

/* Forgot Password Link */
.forgot-link {
    color: var(--auth-primary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--auth-accent);
    text-decoration: underline;
}

/* Submit Button */
.btn-auth-submit {
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: var(--auth-primary);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-auth-submit:hover {
    background-color: var(--auth-primary-hover);
    transform: translateY(-1px);
}

.btn-auth-submit:active {
    transform: translateY(0);
}

/* Auth Switch Link */
.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--auth-text-muted);
}

.auth-switch a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    margin-inline-start: 0.25rem;
}

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

/* ==========================================================================
   Messages
   ========================================================================== */

.auth-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.auth-message i {
    margin-top: 0.125rem;
}

.auth-message p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-message p + p {
    margin-top: 0.5rem;
}

.auth-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--auth-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--auth-success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

.auth-page.rtl,
.auth-page[dir="rtl"] {
    direction: rtl;
}

/* RTL: Reverse the flex order so form appears on the right */
.auth-page.rtl .auth-container,
.auth-page[dir="rtl"] .auth-container {
    flex-direction: column;
}

/* RTL: Text alignment */
.auth-page.rtl .auth-title,
.auth-page[dir="rtl"] .auth-title {
    text-align: right;
}

.auth-page.rtl .form-group label,
.auth-page[dir="rtl"] .form-group label {
    text-align: right;
}

.auth-page.rtl .form-input,
.auth-page[dir="rtl"] .form-input {
    text-align: right;
}

/* RTL: Checkbox label */
.auth-page.rtl .checkbox-label,
.auth-page[dir="rtl"] .checkbox-label {
    flex-direction: row-reverse;
}

/* RTL: Form options */
.auth-page.rtl .form-options,
.auth-page[dir="rtl"] .form-options {
    flex-direction: row-reverse;
}

/* RTL: Form row */
.auth-page.rtl .form-row,
.auth-page[dir="rtl"] .form-row {
    flex-direction: row-reverse;
}

/* RTL: Form row half */
.auth-page.rtl .form-row-half,
.auth-page[dir="rtl"] .form-row-half {
    flex-direction: column;
}

/* RTL: Messages */
.auth-page.rtl .auth-message,
.auth-page[dir="rtl"] .auth-message {
    flex-direction: row-reverse;
    text-align: right;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 576px) {
    .auth-page {
        padding: 2rem;
    }

    .auth-container {
        border-radius: 24px;
    }

    .auth-form-side {
        padding: 2rem;
    }

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

    .form-row-half {
        flex-direction: row;
    }

    .auth-page.rtl .form-row-half,
    .auth-page[dir="rtl"] .form-row-half {
        flex-direction: row-reverse;
    }
}

@media (min-width: 992px) {
    .auth-container {
        max-width: 1100px;
        flex-direction: row;
    }

    .auth-form-side {
        padding: 3rem;
    }

    .auth-page.rtl .auth-container,
    .auth-page[dir="rtl"] .auth-container {
        flex-direction: row-reverse;
    }
}

/* ==========================================================================
   Centered Layout (Forgot/Reset Password)
   ========================================================================== */

.auth-centered-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background-color: var(--auth-bg);
}

.auth-logo {
    margin-bottom: 2rem;
    width: 150px;
}

.auth-logo img {
    width: 100%;
    height: auto;
}

.auth-card {
    background: var(--auth-card-bg);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.auth-card h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--auth-accent);
    text-align: center;
}

.auth-card p {
    color: var(--auth-text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    text-align: center;
}

/* RTL for centered layout */
.auth-centered-layout.rtl,
.auth-centered-layout[dir="rtl"] {
    direction: rtl;
}

.back-to-login {
    margin-top: 1.5rem;
    text-align: center;
}

.back-to-login a {
    color: var(--auth-primary);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-to-login a:hover {
    text-decoration: underline;
}

/* RTL for back to login */
.auth-centered-layout.rtl .back-to-login a,
.auth-centered-layout[dir="rtl"] .back-to-login a {
    flex-direction: row-reverse;
}

/* ==========================================================================
   Auth Icons (Success/Error states)
   ========================================================================== */

.auth-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

.auth-icon-success {
    background-color: rgba(34, 197, 94, 0.15);
    color: var(--auth-success);
}

.auth-icon-error {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--auth-error);
}

.auth-hint {
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    margin-top: 0.5rem;
}
