/**
 * Authentication Pages Styles
 * Login and Registration page styles
 *
 * @package Vanilly
 */

/* ========================================
   Login/Register Page Body
   ======================================== */

body.login-register-page-body {
    margin: 0;
    padding: 0;
    background: #FFFFFF;
}

body.login-register-page-body #page {
    margin: 0;
    padding: 0;
}

/* ========================================
   Login/Register Page Container
   ======================================== */

.login-register-page {
    min-height: 100vh;
    padding: 40px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-register-container {
    display: flex;
    flex-direction: row-reverse;
    max-width: 1400px;
    margin: auto;
    padding: 0 24px;
    gap: 140px;
    align-items: flex-start;
    min-height: 600px;
}

/* ========================================
   Left Column: Form Section
   ======================================== */

.login-register-form-section {
    flex: 0 0 40%;
    max-width: 500px;
    background: #FFFFFF;
    border-radius: 20px;
    border: 1px solid #DEE1E8;
    padding-top: 24px;
    padding-right: 20px;
    padding-bottom: 44px;
    padding-left: 20px;
    gap: 20px;
    display: flex;
    flex-direction: column;
}

/* Tabs */
.auth-tabs {
    display: flex;
    flex-direction: row-reverse;
    gap: 20px;
    margin-bottom: 0;
    border-bottom: 2px solid #E5E5E5;
}

.auth-tab {
    background: none;
    border: none;
    padding: 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #9CA3AF;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    flex: 1;
    width: 100%;
    text-align: center;
}

.auth-tab:hover {
    color: #2E303B;
}

.auth-tab.active {
    color: #2E303B;

}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    left: 0;
    height: 3px;
    background: #2E303B;
    border-radius: 2px 2px 0 0;
}

/* Form Container */
.auth-form-container {
    flex: 1;
}

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

/* Form Fields */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-size: 16px;
    font-weight: 600;
    color: #2E303B;
    text-align: right;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    right: 16px;
    pointer-events: none;
    flex-shrink: 0;
    object-fit: contain;
}

.input-wrapper .input-icon-password {
    right: 16px;
}

.input-wrapper .password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.form-field input {
    width: 100%;
    padding: 16px 50px 16px 16px;
    border: 1px solid #E5E5E5;
    border-radius: 12px;
    font-size: 16px;
    color: #2E303B;
    background: #FFFFFF;
    text-align: right;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-field input:focus {
    outline: none;
    border-color: #6555D3;
    box-shadow: 0 0 0 3px rgba(101, 85, 211, 0.1);
}

.form-field input::placeholder {
    color: #9CA3AF;
}

/* Error Messages */
.field-error {
    color: #EF4444;
    font-size: 12px;
    margin-top: 4px;
    text-align: right;
    min-height: 18px;
}

.field-hint {
    font-size: 12px;
    color: #6B7280;
    margin-top: 4px;
    text-align: right;
}

/* Phone input validation states */
#otp-phone:invalid:not(:placeholder-shown) {
    border-color: #EF4444;
}

#otp-phone:valid:not(:placeholder-shown) {
    border-color: #10B981;
}

/* JavaScript validation classes */
.input-valid {
    border-color: #10B981 !important;
    background-color: #F0FDF4;
}

.input-invalid {
    border-color: #EF4444 !important;
    background-color: #FEF2F2;
}

.auth-error {
    background: #FEE2E2;
    border: 1px solid #EF4444;
    color: #EF4444;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: right;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    height: 60px;
    padding-top: 20px;
    padding-right: 34px;
    padding-bottom: 20px;
    padding-left: 34px;
    gap: 15px;
    background: linear-gradient(180deg, #8476E4 0%, #6555D3 100%);
    border: none;
    border-radius: 10px;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 8px;
    box-shadow: 0px 8px 24px 0px #6555D366;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0px 8px 24px 0px #6555D366;
}

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

/* Links */
.auth-links {
    text-align: center;
    margin-top: 8px;
}

.auth-link {
    color: #2E303B;
    font-size: 14px;
    text-decoration: none;
}

.auth-link span {
    color: #6555D3;
    font-weight: 600;
}

.auth-link:hover span {
    text-decoration: underline;
}

/* Switch Link */
.auth-switch {
    text-align: center;
    margin-top: 8px;
    color: #2E303B;
    font-size: 14px;
    border: 1px solid #DEE1E8;
    height: 60px;
    border-radius: 10px;
    gap: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.switch-link {
    color: #6555D3;
    font-weight: 600;
    text-decoration: none;
}

.switch-link:hover {
    text-decoration: underline;
}

/* ========================================
   Right Column: Branding Section
   ======================================== */

.login-register-branding-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.branding-content {
    max-width: 800px;
    width: 100%;
}

/* Logo */
.branding-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.branding-logo-image {
    width: 60px;
    height: auto;
    flex-shrink: 0;
}

.branding-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.branding-title {
    font-size: 32px;
    font-weight: 800;
    color: #2E303B;
    margin: 0;
    line-height: 1.2;
}

.branding-tagline {
    font-size: 16px;
    font-weight: 400;
    color: #6B7280;
    margin: 0;
    line-height: 1.2;
}

/* Welcome Message */
.branding-welcome {
    font-size: 28px;
    font-weight: 700;
    color: #2E303B;
    margin: 0 0 16px 0;
    text-align: right;
}

/* Description */
.branding-description {
    font-size: 16px;
    line-height: 1.6;
    color: #6B7280;
    margin: 0 0 40px 0;
    text-align: right;
}

/* Benefits List */
.branding-benefits {
    list-style: none;
    padding: 0 !important;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.benefit-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    text-align: right;
}

.benefit-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.benefit-item span {
    font-size: 16px;
    color: #2E303B;
    line-height: 1.5;
    flex: 1;
    font-weight: 700;
}

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

@media (max-width: 991px) {
    .login-register-container {
        flex-direction: column;
        gap: 40px;
    }

    .login-register-form-section {
        flex: 1;
        max-width: 100%;
        padding-top: 24px;
        padding-right: 20px;
        padding-bottom: 44px;
        padding-left: 20px;
        gap: 20px;
        border-radius: 20px;
        border: 1px solid #DEE1E8;
        width: 100%;
    }

    .login-register-branding-section {
        padding: 20px;
    }

    .branding-content {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .login-register-page {
        padding: 20px 0;
    }

    .login-register-container {
        padding: 0 14px;
        gap: 32px;
    }

    .login-register-form-section {
        padding-top: 24px;
        padding-right: 20px;
        padding-bottom: 44px;
        padding-left: 20px;
        gap: 20px;
        border-radius: 20px;
        border: 1px solid #DEE1E8;
    }

    .auth-tabs {
        gap: 24px;
        margin-bottom: 24px;
    }

    .auth-tab {
        font-size: 16px;
        padding: 12px 0;
    }

    .auth-form {
        gap: 20px;
    }

    .form-field input {
        padding: 14px 50px 14px 14px;
        font-size: 14px;
    }

    .auth-submit-btn {
        height: 60px;
        padding-top: 20px;
        padding-right: 34px;
        padding-bottom: 20px;
        padding-left: 34px;
        gap: 15px;
        border-radius: 10px;
        font-size: 14px;
        box-shadow: 0px 8px 24px 0px #6555D366;
    }

    .branding-logo {
        margin-bottom: 24px;
    }

    .branding-title {
        font-size: 24px;
    }

    .branding-welcome {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .branding-description {
        font-size: 14px;
        margin-bottom: 32px;
    }

    .benefit-item {
        gap: 12px;
    }

    .benefit-item span {
        font-size: 14px;
    }
}

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

.auth-form-title {
    font-size: 24px;
    font-weight: 700;
    color: #2E303B;
    margin-bottom: 8px;
    text-align: right;
}

.auth-form-subtitle {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 24px;
    text-align: right;
}

.otp-step {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.otp-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: right;
    margin-top: 8px;
}

.otp-message-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.otp-message-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.auth-link-separator {
    color: #9CA3AF;
    margin: 0 8px;
}

#otp-phone-display {
    font-weight: 600;
    color: #2E303B;
}
