/**
 * עיצוב דף התחברות והרשמה - תכשיטי כליפה
 * 
 * @package Klifa_My_Account_Customizer
 * @since 1.1.0
 */

/* ==================================================
   משתנים CSS
   ================================================== */
:root {
    --klifa-login-primary: #8B7355;
    --klifa-login-accent: #D4AF37;
    --klifa-login-dark: #1a1a1a;
    --klifa-login-gray: #666;
    --klifa-login-light: #f8f9fa;
}

/* ==================================================
   רקע הדף
   ================================================== */
body.klifa-login-page {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    min-height: 100vh;
}

body.klifa-login-page .woocommerce {
    padding: 40px 20px;
}

/* הסתרת כותרת "החשבון שלי" */
body.klifa-login-page .woocommerce > h2,
body.klifa-login-page .woocommerce > .woocommerce-MyAccount-navigation,
body.klifa-login-page .entry-title,
body.klifa-login-page .page-title,
body.klifa-login-page .woocommerce-account > .entry-header {
    display: none !important;
}

/* ביטול עיצובי ברירת מחדל של WooCommerce */
body.klifa-login-page .woocommerce .col2-set {
    display: block !important;
    width: 100% !important;
    float: none !important;
}

body.klifa-login-page .woocommerce .col2-set .col-1,
body.klifa-login-page .woocommerce .col2-set .col-2 {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* ==================================================
   עטיפה ראשית - Auth Wrapper (עיצוב חדש)
   ================================================== */
.klifa-auth-wrapper {
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    max-width: 1000px;
    margin: 40px auto;
    overflow: hidden;
    direction: rtl;
    display: grid;
    grid-template-columns: 380px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 600px;
}

/* ==================================================
   Header - צד שמאל (כולל יתרונות)
   ================================================== */
.klifa-auth-header {
    background: linear-gradient(135deg, var(--klifa-login-dark) 0%, #2a2a2a 100%);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    grid-column: 1;
    grid-row: 1 / 3;
    min-height: 100%;
}

.klifa-auth-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 50%);
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.klifa-auth-logo {
    position: relative;
    z-index: 1;
    margin-bottom: 25px;
}

.klifa-auth-logo img {
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 5px 20px rgba(212, 175, 55, 0.4));
}

.klifa-logo-placeholder {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--klifa-login-accent) 0%, #B8860B 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

.klifa-logo-placeholder svg {
    color: white;
}

.klifa-auth-title {
    position: relative;
    z-index: 1;
    color: white;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
}

.klifa-auth-subtitle {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    margin: 0 0 30px;
    line-height: 1.6;
}

/* יתרונות בתוך ה-Header */
.klifa-auth-benefits {
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: right;
    margin-top: 20px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.klifa-auth-benefits h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--klifa-login-accent);
    margin: 0 0 18px;
    text-align: center;
}

.klifa-auth-benefits ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.klifa-auth-benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.klifa-auth-benefits li svg {
    width: 20px;
    height: 20px;
    color: var(--klifa-login-accent);
    flex-shrink: 0;
}

/* אבטחה */
.klifa-auth-secure {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.klifa-auth-secure svg {
    width: 20px;
    height: 20px;
    color: #4ade80;
}

.klifa-auth-secure span {
    font-size: 13px;
    color: #4ade80;
    font-weight: 500;
}

/* ==================================================
   טאבים - צד ימין למעלה
   ================================================== */
.klifa-auth-tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    grid-column: 2;
    grid-row: 1;
}

.klifa-auth-tab {
    flex: 1;
    padding: 22px 25px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    color: var(--klifa-login-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.klifa-auth-tab:hover {
    color: var(--klifa-login-dark);
    background: rgba(212, 175, 55, 0.05);
}

.klifa-auth-tab.active {
    color: var(--klifa-login-accent);
    background: white;
}

.klifa-auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--klifa-login-accent) 0%, #B8860B 100%);
}

.klifa-auth-tab svg {
    width: 20px;
    height: 20px;
}

/* ==================================================
   תוכן הטפסים - צד ימין
   ================================================== */
.klifa-auth-forms {
    padding: 40px 45px;
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.klifa-auth-forms .u-columns,
.klifa-auth-forms .col2-set {
    display: block !important;
}

.klifa-auth-forms .u-column1,
.klifa-auth-forms .u-column2,
.klifa-auth-forms .col-1,
.klifa-auth-forms .col-2 {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    max-width: 100% !important;
}

/* הסתר כותרות h2 ("התחברות" / "הרשמה") - יש לנו טאבים במקום */
.klifa-auth-forms h2,
.klifa-auth-forms .u-column1 > h2,
.klifa-auth-forms .u-column2 > h2 {
    display: none !important;
}

/* ==================================================
   שדות טופס
   ================================================== */
.klifa-auth-forms .woocommerce-form-row,
.klifa-auth-forms .form-row {
    margin-bottom: 22px;
}

.klifa-auth-forms .woocommerce-form-row label,
.klifa-auth-forms .form-row label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--klifa-login-dark);
    margin-bottom: 10px;
}

.klifa-auth-forms .woocommerce-form-row label .required,
.klifa-auth-forms .form-row label .required {
    color: var(--klifa-login-accent);
}

.klifa-auth-forms input[type="text"],
.klifa-auth-forms input[type="email"],
.klifa-auth-forms input[type="tel"],
.klifa-auth-forms input[type="password"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--klifa-login-light);
}

.klifa-auth-forms input[type="text"]:focus,
.klifa-auth-forms input[type="email"]:focus,
.klifa-auth-forms input[type="tel"]:focus,
.klifa-auth-forms input[type="password"]:focus {
    outline: none;
    border-color: var(--klifa-login-accent);
    background: white;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}

.klifa-auth-forms input::placeholder {
    color: #aaa;
}

/* ==================================================
   זכור אותי
   ================================================== */
.klifa-auth-forms .woocommerce-form-login__rememberme {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    cursor: pointer;
    font-size: 14px;
}

.klifa-auth-forms .woocommerce-form-login__rememberme input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--klifa-login-accent);
}

/* ==================================================
   שכחתי סיסמה
   ================================================== */
.klifa-auth-forms .woocommerce-LostPassword {
    text-align: center;
    margin-top: 20px;
}

.klifa-auth-forms .woocommerce-LostPassword a {
    color: var(--klifa-login-accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.klifa-auth-forms .woocommerce-LostPassword a:hover {
    text-decoration: underline;
}

/* ==================================================
   כפתורים
   ================================================== */
.klifa-auth-forms button[type="submit"],
.klifa-auth-forms .woocommerce-button {
    width: 100%;
    padding: 18px 28px;
    background: linear-gradient(135deg, var(--klifa-login-accent) 0%, #B8860B 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.35);
}

.klifa-auth-forms button[type="submit"]:hover,
.klifa-auth-forms .woocommerce-button:hover {
    background: linear-gradient(135deg, #B8860B 0%, var(--klifa-login-accent) 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(212, 175, 55, 0.45);
}

/* ==================================================
   הודעות
   ================================================== */
.klifa-auth-forms .woocommerce-error,
.klifa-auth-forms .woocommerce-message,
.klifa-auth-forms .woocommerce-info {
    margin: 0 0 25px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    list-style: none;
}

.klifa-auth-forms .woocommerce-error {
    background: #fef2f2;
    color: #dc2626;
    border-right: 4px solid #dc2626;
}

.klifa-auth-forms .woocommerce-message {
    background: #f0fdf4;
    color: #16a34a;
    border-right: 4px solid #16a34a;
}

/* ==================================================
   מצב תצוגה - התחברות / הרשמה
   ================================================== */
.klifa-auth-wrapper.show-register .u-column1 {
    display: none !important;
}

.klifa-auth-wrapper.show-register .u-column2 {
    display: block !important;
}

.klifa-auth-forms .form-row.focused label {
    color: var(--klifa-login-accent);
}

/* ==================================================
   Footer - removed (benefits moved to header)
   ================================================== */

/* ==================================================
   רספונסיביות - טאבלט
   ================================================== */
@media (max-width: 900px) {
    .klifa-auth-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        max-width: 500px;
        min-height: auto;
    }
    
    .klifa-auth-header {
        grid-column: 1;
        grid-row: 1;
        padding: 35px 30px;
        min-height: auto;
    }
    
    .klifa-auth-title {
        font-size: 22px;
    }
    
    .klifa-auth-subtitle {
        margin-bottom: 15px;
    }
    
    .klifa-auth-benefits {
        display: none;
    }
    
    .klifa-auth-secure {
        margin-top: 15px;
    }
    
    .klifa-auth-tabs {
        grid-column: 1;
        grid-row: 2;
    }
    
    .klifa-auth-forms {
        grid-column: 1;
        grid-row: 3;
        padding: 30px;
    }
}

/* ==================================================
   רספונסיביות - מובייל
   ================================================== */
@media (max-width: 600px) {
    body.klifa-login-page .woocommerce {
        padding: 20px 15px;
    }
    
    .klifa-auth-wrapper {
        margin: 20px auto;
        border-radius: 16px;
    }
    
    .klifa-auth-header {
        padding: 30px 20px;
    }
    
    .klifa-auth-logo img {
        max-width: 130px;
    }
    
    .klifa-auth-title {
        font-size: 20px;
    }
    
    .klifa-auth-subtitle {
        font-size: 14px;
    }
    
    .klifa-auth-tab {
        padding: 16px 15px;
        font-size: 14px;
    }
    
    .klifa-auth-forms {
        padding: 25px 20px;
    }
    
    .klifa-auth-forms input[type="text"],
    .klifa-auth-forms input[type="email"],
    .klifa-auth-forms input[type="tel"],
    .klifa-auth-forms input[type="password"] {
        padding: 14px 16px;
    }
    
    .klifa-auth-forms button[type="submit"],
    .klifa-auth-forms .woocommerce-button {
        padding: 16px 24px;
    }
}

/* ==================================================
   Password visibility toggle
   ================================================== */
.klifa-password-toggle {
    position: relative;
}

.klifa-password-toggle input {
    padding-left: 45px;
}

.klifa-password-toggle .toggle-password {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--klifa-login-gray);
    padding: 5px;
}

.klifa-password-toggle .toggle-password:hover {
    color: var(--klifa-login-accent);
}
