/* ============================================
   Alpine My Account Login/Register Forms
   Solid Light Theme - Professional Design
   RTL Support for Hebrew
   ============================================ */

/* ============================================
   1. ROOT VARIABLES & BASE SETUP
   ============================================ */

   :root {
    --alpine-login-bg: #ffffff;
    --alpine-login-card-bg: #ffffff;
    --alpine-login-primary: #e0192e;
    --alpine-login-primary-hover: #c01729;
    --alpine-login-secondary: #6c757d;
    --alpine-login-success: #28a745;
    --alpine-login-danger: #dc3545;
    --alpine-login-border: #e0e0e0;
    --alpine-login-border-focus: #e0192e;
    --alpine-login-text: #333333;
    --alpine-login-text-muted: #666666;
    --alpine-login-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --alpine-login-shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
    --alpine-login-radius: 8px;
    --alpine-login-radius-small: 6px;
    --alpine-login-transition: all 0.3s ease;
}

/* ============================================
   2. MAIN CONTAINER & LAYOUT - OVERRIDE WIDTHS
   ============================================ */

.woocommerce-account .woocommerce {
    background: var(--alpine-login-bg) !important;
    min-height: 100vh;
    padding: 40px 20px;
    direction: rtl;
}

/* Customer Login Container - OVERRIDE COLUMN WIDTHS */
#customer_login {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 40px !important;
    /* background: var(--alpine-login-card-bg) !important; */
    /* border-radius: var(--alpine-login-radius); */
    /* box-shadow: var(--alpine-login-shadow); */
    overflow: hidden;
    position: relative;
    /* border: 1px solid var(--alpine-login-border); */
}

/* Single Column Layout (when registration is disabled) */
#customer_login:not(.col2-set) {
    grid-template-columns: 1fr !important;
    max-width: 600px !important;
}

/* ============================================
   3. COLUMN OVERRIDES - STRICT WIDTH CONTROL
   ============================================ */

/* Override WooCommerce column classes */
.u-columns.col2-set {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

.u-column1.col-1 {
    width: 50% !important;
    max-width: none !important;
    flex: 1 !important;
    padding: 50px 40px !important;
    background: var(--alpine-login-card-bg) !important;
    position: relative;
    /* border-left: 1px solid var(--alpine-login-border); */
}

.u-column2.col-2 {
    width: 50% !important;
    max-width: none !important;
    flex: 1 !important;
    padding: 50px 40px !important;
    background: #f8f9fa !important;
    position: relative;
}

/* ============================================
   4. LOGIN SECTION STYLING
   ============================================ */

.u-column1.col-1::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--alpine-login-primary);
}

/* Login Header */
.u-column1.col-1 h2 {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--alpine-login-text) !important;
    margin: 0 0 30px 0 !important;
    text-align: center !important;
    position: relative;
}

.u-column1.col-1 h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--alpine-login-primary);
    border-radius: 2px;
}

/* ============================================
   5. REGISTER SECTION STYLING
   ============================================ */

.u-column2.col-2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--alpine-login-success);
}

/* Register Header */
.u-column2.col-2 h2 {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--alpine-login-text) !important;
    margin: 0 0 30px 0 !important;
    text-align: center !important;
    position: relative;
}

.u-column2.col-2 h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--alpine-login-success);
    border-radius: 2px;
}

/* ============================================
   6. FORM STYLING - COMPLETE OVERRIDE
   ============================================ */

/* Form Rows */
.woocommerce-form-row {
    margin-bottom: 25px !important;
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.woocommerce-form-row--wide {
    width: 100% !important;
    margin-bottom: 25px !important;
}

.woocommerce-form-row--first {
    width: 100% !important;
    margin-bottom: 25px !important;
}

.woocommerce-form-row--last {
    width: 100% !important;
    margin-bottom: 25px !important;
}

/* Labels */
.woocommerce-form-row label {
    display: block !important;
    font-weight: 600 !important;
    color: var(--alpine-login-text) !important;
    margin-bottom: 8px !important;
    font-size: 14px !important;
    transition: var(--alpine-login-transition);
}

.woocommerce-form-row label .required {
    color: var(--alpine-login-danger) !important;
    margin-left: 3px;
}

/* Input Fields - COMPLETE OVERRIDE */
.woocommerce-Input[type="text"],
.woocommerce-Input[type="email"],
.woocommerce-Input[type="password"],
.woocommerce-Input[type="tel"] {
    width: 100% !important;
    padding: 15px 20px !important;
    border: 2px solid var(--alpine-login-border) !important;
    border-radius: var(--alpine-login-radius-small) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: var(--alpine-login-text) !important;
    background: #ffffff !important;
    transition: var(--alpine-login-transition) !important;
    box-sizing: border-box !important;
    direction: rtl !important;
    outline: none !important;
    display: block !important;
    margin: 0 !important;
}

.woocommerce-Input[type="text"]:focus,
.woocommerce-Input[type="email"]:focus,
.woocommerce-Input[type="password"]:focus,
.woocommerce-Input[type="tel"]:focus {
    outline: none !important;
    border-color: var(--alpine-login-border-focus) !important;
    box-shadow: 0 0 0 3px rgba(224, 25, 46, 0.1) !important;
    transform: translateY(-1px) !important;
}

.woocommerce-Input::placeholder {
    color: var(--alpine-login-text-muted) !important;
    font-weight: 400 !important;
}

/* Input Focus States */
.woocommerce-form-row:focus-within label {
    color: var(--alpine-login-primary) !important;
}

/* ============================================
   7. CHECKBOX & REMEMBER ME - SEPARATE STYLING
   ============================================ */

.woocommerce-form__label-for-checkbox {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    color: var(--alpine-login-text) !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.woocommerce-form__input-checkbox {
    width: 18px !important;
    height: 18px !important;
    accent-color: var(--alpine-login-primary) !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 2px solid var(--alpine-login-border) !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    outline: none !important;
    display: inline-block !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.woocommerce-form__input-checkbox:checked {
    background: var(--alpine-login-primary) !important;
    border-color: var(--alpine-login-primary) !important;
}

.woocommerce-form__input-checkbox:focus {
    outline: 2px solid var(--alpine-login-primary) !important;
    outline-offset: 2px !important;
}

.woocommerce-form__input-checkbox:hover {
    border-color: var(--alpine-login-primary) !important;
}

/* Custom checkbox styling for better appearance */
.woocommerce-form__input-checkbox::after {
    content: '✓' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: bold !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
}

.woocommerce-form__input-checkbox:checked::after {
    opacity: 1 !important;
}

/* ============================================
   7.1. PASSWORD INPUT WRAPPER
   ============================================ */

/* Password Input Wrapper - Must have 100% width */
.password-input-wrapper {
    width: 100% !important;
    display: block !important;
    position: relative !important;
}

.password-input-wrapper span {
    width: 100% !important;
    display: block !important;
    position: relative !important;
}

.password-input-wrapper .woocommerce-Input {
    width: 100% !important;
}

/* ============================================
   7.2. PASSWORD TOGGLE BUTTON
   ============================================ */

/* Hide emoji-based password toggle (WooCommerce default) */
.show-password-input {
    display: none !important;
}

/* Password toggle button - positioned at end */
.password-toggle,
button.password-toggle,
.display-password {
    position: absolute !important;
    inset: auto !important;
    inset-inline-end: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 24px !important;
    height: 24px !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--alpine-login-text-muted) !important;
    font-size: 14px !important;
    transition: var(--alpine-login-transition) !important;
    z-index: 10 !important;
}

.password-toggle:hover,
button.password-toggle:hover,
.display-password:hover {
    color: var(--alpine-login-primary) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.password-toggle:focus,
button.password-toggle:focus,
.display-password:focus {
    outline: 2px solid var(--alpine-login-primary) !important;
    outline-offset: 2px !important;
    border-radius: 4px !important;
}

/* Password field container for positioning */
.woocommerce-form-row:has(input[type="password"]) {
    position: relative !important;
}

/* Adjust password input padding to make room for button */
.woocommerce-Input[type="password"] {
    padding-inline-end: 50px !important;
}

/* SVG Icon Support - Clean icon display */
.password-toggle svg,
button.password-toggle svg,
.display-password svg {
    width: 18px !important;
    height: 18px !important;
    fill: currentColor !important;
    transition: var(--alpine-login-transition) !important;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .password-toggle,
    button.password-toggle,
    .display-password {
        width: 20px !important;
        height: 20px !important;
        inset-inline-end: 8px !important;
    }

    .woocommerce-Input[type="password"] {
        padding-inline-end: 40px !important;
    }
}

/* ============================================
   8. BUTTONS - COMPLETE OVERRIDE
   ============================================ */

.woocommerce-button,
.woocommerce-Button {
    width: 100% !important;
    padding: 16px 24px !important;
    background: var(--alpine-login-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: var(--alpine-login-radius-small) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    transition: var(--alpine-login-transition) !important;
    position: relative !important;
    overflow: hidden !important;
    text-decoration: none !important;
    display: inline-block !important;
    text-align: center !important;
}

.woocommerce-button:hover,
.woocommerce-Button:hover {
    background: var(--alpine-login-primary-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(224, 25, 46, 0.3) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.woocommerce-button:active,
.woocommerce-Button:active {
    transform: translateY(0) !important;
}

/* Button Loading State */
.woocommerce-button:disabled,
.woocommerce-Button:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ============================================
   9. LINKS & ADDITIONAL OPTIONS
   ============================================ */

.woocommerce-LostPassword {
    text-align: center !important;
    margin-top: 20px !important;
}

.woocommerce-LostPassword a {
    color: var(--alpine-login-primary) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: var(--alpine-login-transition) !important;
    position: relative !important;
}

.woocommerce-LostPassword a:hover {
    color: var(--alpine-login-primary-hover) !important;
    text-decoration: underline !important;
}

/* ============================================
   10. FORM VALIDATION & ERRORS
   ============================================ */

.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    padding: 15px 20px !important;
    margin-bottom: 20px !important;
    border-radius: var(--alpine-login-radius-small) !important;
    font-weight: 500 !important;
    border-right: 4px solid !important;
}

.woocommerce-error {
    background: #f8d7da !important;
    color: #721c24 !important;
    border-color: var(--alpine-login-danger) !important;
}

.woocommerce-message {
    background: #d4edda !important;
    color: #155724 !important;
    border-color: var(--alpine-login-success) !important;
}

.woocommerce-info {
    background: #d1ecf1 !important;
    color: #0c5460 !important;
    border-color: #17a2b8 !important;
}

/* ============================================
   11. RESPONSIVE DESIGN - MOBILE OVERRIDE
   ============================================ */

@media (max-width: 768px) {
    .woocommerce-account .woocommerce {
        padding: 20px 15px !important;
    }
    
    #customer_login {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        margin: 0 !important;
        border-radius: var(--alpine-login-radius) !important;
    }
    
    .u-columns.col2-set {
        grid-template-columns: 1fr !important;
    }
    
    .u-column1.col-1,
    .u-column2.col-2 {
        width: 100% !important;
        padding: 30px 25px !important;
    }
    
    .u-column2.col-2 {
        border-right: none !important;
        border-top: 1px solid var(--alpine-login-border) !important;
    }
    
    .u-column1.col-1 h2,
    .u-column2.col-2 h2 {
        font-size: 24px !important;
        margin-bottom: 25px !important;
    }
    
    .woocommerce-Input {
        padding: 12px 16px !important;
        font-size: 16px !important;
    }
    
    .woocommerce-button,
    .woocommerce-Button {
        padding: 14px 20px !important;
        font-size: 15px !important;
    }
}

@media (max-width: 480px) {
    .woocommerce-account .woocommerce {
        padding: 15px 10px !important;
    }
    
    .u-column1.col-1,
    .u-column2.col-2 {
        padding: 25px 20px !important;
    }
    
    .u-column1.col-1 h2,
    .u-column2.col-2 h2 {
        font-size: 22px !important;
    }
}

/* ============================================
   12. ANIMATIONS & ENHANCEMENTS
   ============================================ */

/* Form Animation */
.woocommerce-form {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Focus Animation */
.woocommerce-Input:focus {
    animation: inputFocus 0.3s ease-out;
}

@keyframes inputFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(224, 25, 46, 0.1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(224, 25, 46, 0.1);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(224, 25, 46, 0.1);
    }
}

/* Button Hover Animation */
.woocommerce-button::before,
.woocommerce-Button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.woocommerce-button:hover::before,
.woocommerce-Button:hover::before {
    left: 100%;
}

/* ============================================
   13. ACCESSIBILITY & UX IMPROVEMENTS
   ============================================ */

/* Focus Indicators */
.woocommerce-Input:focus,
.woocommerce-button:focus,
.woocommerce-Button:focus {
    outline: 2px solid var(--alpine-login-primary) !important;
    outline-offset: 2px !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .woocommerce-Input {
        border-width: 3px !important;
    }
    
    .woocommerce-button,
    .woocommerce-Button {
        border: 2px solid var(--alpine-login-primary) !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .woocommerce-form,
    .woocommerce-Input,
    .woocommerce-button,
    .woocommerce-Button {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   14. STRICT OVERRIDES - FORCE STYLING
   ============================================ */

/* Force override any existing styles */
.woocommerce-account .woocommerce form.login,
.woocommerce-account .woocommerce form.register {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    display: block !important;
}

/* Form field containers */
.woocommerce-account .woocommerce .form-row {
    margin-bottom: 25px !important;
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.woocommerce-account .woocommerce .form-row-wide {
    width: 100% !important;
    margin-bottom: 25px !important;
}

.woocommerce-account .woocommerce .form-row-first {
    width: 100% !important;
    margin-bottom: 25px !important;
}

.woocommerce-account .woocommerce .form-row-last {
    width: 100% !important;
    margin-bottom: 25px !important;
}

.woocommerce-account .woocommerce .col-1,
.woocommerce-account .woocommerce .col-2 {
    width: 100% !important;
    max-width: none !important;
    float: none !important;
    display: block !important;
}

/* Override any WooCommerce default styles */
.woocommerce-account .woocommerce .woocommerce-form-login,
.woocommerce-account .woocommerce .woocommerce-form-register {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    display: block !important;
}

/* Ensure proper form structure */
.woocommerce-account .woocommerce .woocommerce-form-login p,
.woocommerce-account .woocommerce .woocommerce-form-register p {
    margin-bottom: 25px !important;
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

/* Clear any floats that might interfere */
.woocommerce-account .woocommerce .clear {
    clear: both !important;
    display: block !important;
    width: 100% !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   15. PRINT STYLES
   ============================================ */

@media print {
    .woocommerce-account .woocommerce {
        background: white !important;
        padding: 0 !important;
    }
    
    #customer_login {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .woocommerce-button,
    .woocommerce-Button {
        background: white !important;
        color: black !important;
        border: 1px solid black !important;
    }
}