/* کانتینر اصلی */
.wrapper-fix {
--main-color: #323232;
--bg-color: #fff;
--font-color: #838383;
--input-focus: #2d8cf0;
display: flex;
justify-content: center;
align-items: flex-start;
padding-top: 40px; /* فضای از بالا */
width: 100%;
min-height: 450px;
direction: rtl; /* جهت راستچین */
box-sizing: border-box;
}
/* کانتینر سوییچ */
.card-switch {
position: relative;
width: 300px; /* عرض ثابت برابر با کارت */
display: flex;
justify-content: center;
}
.switch {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}
/* --- اصلاح بخش دکمه بالا --- */
.slider {
position: relative;
width: 60px; /* عرض دکمه */
height: 30px; /* ارتفاع دکمه */
border-radius: 5px;
background-color: var(--bg-color);
border: 2px solid var(--main-color);
box-shadow: 4px 4px var(--main-color); /* سایه ۴ پیکسلی */
cursor: pointer;
z-index: 20;
transition: 0.3s;
}
/* دایره داخل دکمه */
.slider:before {
position: absolute;
content: "";
height: 20px;
width: 20px;
border: 2px solid var(--main-color);
border-radius: 2px; /* کمی گوشهدار مثل طرح اصلی */
background-color: var(--bg-color);
box-shadow: 2px 2px var(--main-color); /* سایه ریز برای دکمه داخلی */
left: 3px; /* فاصله از چپ */
bottom: 3px;
transition: 0.3s;
}
.toggle { display: none; }
/* حالت فعال دکمه */
.toggle:checked + .slider { background-color: var(--input-focus); }
.toggle:checked + .slider:before { transform: translateX(28px); } /* حرکت به راست */
/* متنهای کنار سوییچ (فیکس شده) */
.card-side::before {
position: absolute;
content: 'ورود';
right: 50px; /* فاصله از راست دکمه */
top: 5px;
font-weight: 800;
font-size: 16px;
color: var(--font-color);
text-decoration: underline;
z-index: 10;
white-space: nowrap;
}
.card-side::after {
position: absolute;
content: 'ثبتنام';
left: 50px; /* فاصله از چپ دکمه */
top: 5px;
font-weight: 800;
font-size: 16px;
color: var(--font-color);
opacity: 0.5; /* کمرنگ وقتی فعال نیست */
z-index: 10;
white-space: nowrap;
}
/* تغییر استایل متنها وقتی سوییچ عوض میشه */
.toggle:checked ~ .card-side::before {
text-decoration: none;
opacity: 0.5;
}
.toggle:checked ~ .card-side::after {
text-decoration: underline;
opacity: 1;
}
/* --- بدنه اصلی کارت --- */
.flip-card__inner {
width: 300px !important; /* عرض ثابت اجباری */
height: 350px;
position: relative;
background-color: transparent;
perspective: 1000px;
margin-top: 30px; /* فاصله کارت از دکمه سوییچ */
text-align: center;
transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* انیمیشن نرم */
transform-style: preserve-3d;
}
.toggle:checked ~ .flip-card__inner {
transform: rotateY(180deg);
}
.toggle:checked ~ .flip-card__front {
box-shadow: none; /* حذف سایه وقتی میچرخد */
}
/* ظاهر پشت و روی کارت */
.flip-card__front,
.flip-card__back {
padding: 20px;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
background: lightgrey; /* رنگ زمینه کارت */
border-radius: 5px;
border: 2px solid var(--main-color);
box-shadow: 4px 4px var(--main-color); /* سایه اصلی */
box-sizing: border-box;
gap: 15px;
}
.flip-card__back {
transform: rotateY(180deg);
}
/* عنوانها */
.title {
margin-bottom: 10px;
font-size: 24px;
font-weight: 900;
color: var(--main-color);
}
/* فرم و اینپوتها */
.flip-card__form {
display: flex;
flex-direction: column;
gap: 15px;
width: 100%;
}
.flip-card__input {
all: unset;
width: 100%;
height: 40px;
background-color: var(--bg-color);
border: 2px solid var(--main-color);
border-radius: 5px;
box-shadow: 4px 4px var(--main-color);
font-size: 14px;
font-weight: 600;
color: var(--font-color);
padding: 0 10px;
box-sizing: border-box;
text-align: center;
}
.flip-card__input::placeholder {
color: #666;
}
.flip-card__input:focus {
border-color: var(--input-focus);
transform: translateY(-2px); /* حرکت ریز موقع کلیک */
}
/* دکمه پایین فرم */
.flip-card__btn {
all: unset;
width: 120px;
height: 40px;
margin: 10px auto 0 auto;
background-color: var(--bg-color);
border: 2px solid var(--main-color);
border-radius: 5px;
box-shadow: 4px 4px var(--main-color);
font-size: 16px;
font-weight: 800;
color: var(--main-color);
cursor: pointer;
text-align: center;
transition: 0.1s;
}
.flip-card__btn:active {
box-shadow: 0px 0px var(--main-color);
transform: translate(4px, 4px); /* افکت فشرده شدن */
}