
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Cairo',sans-serif;min-height:100vh;overflow-x:hidden;background:linear-gradient(135deg,#EDE4FA,#F6EFFC 25%,#E4D6F5 50%,#F3EAFB 75%,#E9DFF7);background-size:400% 400%;animation:bg 20s ease infinite;display:flex;justify-content:center;align-items:center;padding:40px 20px;-webkit-overflow-scrolling:touch}
@keyframes bg{0%,100%{background-position:0% 50%}50%{background-position:100% 50%}}
body::before,body::after{content:'';position:fixed;border-radius:50%;z-index:0;pointer-events:none;filter:blur(60px);opacity:.5}
body::before{width:45vw;height:45vw;top:-12vw;right:-10vw;background:radial-gradient(circle,#D9B8F0,transparent 70%);animation:blob 12s ease-in-out infinite alternate}
body::after{width:40vw;height:40vw;bottom:-10vw;left:-8vw;background:radial-gradient(circle,#C0A6E8,transparent 70%);animation:blob 15s ease-in-out infinite alternate-reverse}
@keyframes blob{from{transform:translateY(0) scale(1)}to{transform:translateY(30px) scale(1.1)}}
.floats-container{position:fixed;inset:0;pointer-events:none;z-index:0;overflow:hidden}
.float-item{position:absolute;bottom:-70px;opacity:0;animation:up 14s infinite ease-in-out;filter:drop-shadow(0 0 8px rgba(155,110,200,.45))}
@keyframes up{0%{transform:translateY(0) rotate(-8deg) scale(.5);opacity:0}10%{opacity:.95}30%{transform:translateY(-30vh) translateX(18px) rotate(10deg) scale(.85)}50%{opacity:.85;transform:translateY(-52vh) translateX(-14px) rotate(-8deg) scale(1)}70%{transform:translateY(-75vh) translateX(16px) rotate(8deg) scale(1.05)}90%{opacity:.5}100%{transform:translateY(-110vh) translateX(-10px) rotate(-5deg) scale(1.15);opacity:0}}
.float-item:nth-child(1){left:6%;font-size:34px;animation-delay:0s;animation-duration:14s}
.float-item:nth-child(2){left:20%;font-size:26px;animation-delay:2.5s;animation-duration:17s}
.float-item:nth-child(3){left:38%;font-size:38px;animation-delay:5s;animation-duration:13s}
.float-item:nth-child(4){left:58%;font-size:28px;animation-delay:7s;animation-duration:16s}
.float-item:nth-child(5){left:74%;font-size:36px;animation-delay:1s;animation-duration:15s}
.float-item:nth-child(6){left:90%;font-size:26px;animation-delay:9s;animation-duration:12s}
.login-container{position:relative;z-index:2;text-align:center;max-width:900px;width:100%}
.heart-container{position:relative;width:650px;height:600px;margin:0 auto;display:flex;align-items:center;justify-content:center}
.big-heart{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;animation:beat 2.5s infinite;filter:drop-shadow(0 10px 40px rgba(140,95,190,.25)) drop-shadow(0 0 30px rgba(190,150,230,.3));will-change:transform}
.big-heart::before{content:"";display:block;width:560px;height:560px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23CBAEEB'/%3E%3Cstop offset='45%25' stop-color='%23B692E0'/%3E%3Cstop offset='100%25' stop-color='%239E77CE'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M50 85 C50 85 5 55 5 28 C5 14 16 5 28 5 C36 5 43 9 50 17 C57 9 64 5 72 5 C84 5 95 14 95 28 C95 55 50 85 50 85Z' fill='url(%23g)'/%3E%3C/svg%3E") no-repeat center/contain}
@keyframes beat{0%,100%{transform:scale(1)}10%,30%{transform:scale(1.04)}20%,40%{transform:scale(1)}}
.login-content{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:65%;z-index:3;padding:30px 25px}
.photo-circle-wrap{display:flex;justify-content:center;margin-bottom:14px}
.photo-circle{width:100px;height:100px;border-radius:50%;border:4px solid rgba(140,95,190,.5);overflow:hidden;animation:glow 3s ease-in-out infinite alternate}
@keyframes glow{0%{box-shadow:0 0 0 3px rgba(200,165,235,.35),0 8px 25px rgba(140,95,190,.12),0 0 14px rgba(200,165,235,.35)}100%{box-shadow:0 0 0 6px rgba(200,165,235,.8),0 8px 30px rgba(140,95,190,.28),0 0 32px rgba(200,165,235,.75)}}
.photo-circle img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.login-title{font-size:1.9em;color:#4B2C6E;font-weight:900;margin-bottom:4px;text-shadow:0 2px 6px rgba(255,255,255,.9);letter-spacing:1px}
.login-subtitle{font-size:.95em;color:#7B54A8;margin-bottom:20px;font-weight:600;text-shadow:0 1px 4px rgba(255,255,255,.7);letter-spacing:2px}
.error-msg{background:rgba(200,80,120,.12);border:2px solid rgba(200,80,120,.28);color:#8B2555;padding:10px;border-radius:12px;margin-bottom:14px;font-size:.9em}
.input-group{margin-bottom:16px}
.input-group label{display:block;margin-bottom:7px;color:#4B2C6E;font-size:.92em;font-weight:700;text-align:right;text-shadow:0 1px 3px rgba(255,255,255,.85)}
.input-group input{width:80%;padding:8px 12px;border:2px solid rgba(140,95,190,.35);border-radius:14px;font-size:1.6em;font-weight:900;font-family:'Cairo',sans-serif;background:rgba(255,252,255,.7);color:#4B2C6E;text-align:center;backdrop-filter:blur(10px);letter-spacing:3px;transition:all .3s ease}
.input-group input:focus{outline:none;border-color:#9E77CE;background:rgba(255,252,255,.94);box-shadow:0 4px 18px rgba(140,95,190,.25);transform:translateY(-2px)}
.input-group input::placeholder{color:rgba(140,95,190,.45);font-size:.6em;letter-spacing:1px}
.login-btn{width:100%;padding:14px;background:linear-gradient(135deg,#B692E0,#9E77CE,#8A63BC);border:2.5px solid rgba(255,255,255,.55);border-radius:14px;color:#FFF9FF;font-size:1.15em;font-weight:900;cursor:pointer;font-family:'Cairo',sans-serif;box-shadow:0 8px 25px rgba(140,95,190,.3);transition:all .4s ease;margin-top:8px;letter-spacing:1px;position:relative;overflow:hidden}
.login-btn::before{content:'';position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.35),transparent);transition:left .5s ease}
.login-btn:hover::before{left:100%}
.login-btn:hover{transform:translateY(-4px);box-shadow:0 14px 38px rgba(140,95,190,.45);background:linear-gradient(135deg,#8A63BC,#9E77CE,#B692E0)}
.login-btn:active{transform:translateY(-1px)}
@media(max-width:768px){body{padding:20px 15px}.heart-container{width:400px;height:400px}.big-heart{animation:none;transform:translateZ(0) scale(1)}.big-heart::before{width:360px;height:360px}.login-content{width:75%;padding:20px}.photo-circle{width:75px;height:75px;animation:none}.login-title{font-size:1.45em}.login-subtitle{font-size:.82em;margin-bottom:16px}.input-group{margin-bottom:13px}.input-group label{font-size:.88em}.input-group input{padding:11px 13px;font-size:.92em}.login-btn{padding:13px;font-size:1.05em}}
@media(max-width:480px){.heart-container{width:320px;height:320px}.big-heart::before{width:300px;height:300px}.login-content{width:80%;padding:14px}.photo-circle{width:62px;height:62px}.login-title{font-size:1.25em}.login-subtitle{font-size:.8em}}

/* ===== إصلاحات iOS =====
   سفاري بيعمل زووم إجباري على أي خانة إدخال حجم خطها أقل من 16px، فالصفحة
   بتتحرك والكيبورد بيطلع والزائر بيحس إنها علّقت. 16px بالظبط بيلغي الزووم.
   (ملاحظة: user-scalable=no مش بيمنعه — iOS بيتجاهله من إصدار 10) */
@media (max-width: 900px) {
  input, textarea, select { font-size: 16px !important; }
}
/* الكيبورد مايغطيش الخانة، والتمرير يبقى ناعم على iOS */
input, textarea { -webkit-appearance: none; border-radius: inherit; }

/* ===== تخفيف الحِمل على الموبايل =====
   العناصر المتحركة كانت بتتكوّم: 3 قلوب كل 0.6 ثانية × عمر 15 ثانية
   = 75 عنصر متحرك في نفس اللحظة. المتصفح بيعيد رسمهم 60 مرة/ثانية
   وده بيخنق معالج الموبايل. */
.float-item, .heart, .petal, .bubble, .sparkle {
  will-change: transform, opacity;   /* يرسمهم على كارت الشاشة مش المعالج */
  contain: layout style paint;       /* يمنع إعادة حساب باقي الصفحة */
}
/* لو المستخدم مفعّل "تقليل الحركة" في إعدادات جهازه، نحترمها */
@media (prefers-reduced-motion: reduce) {
  .float-item, .heart, .petal, .bubble, .sparkle { display: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; }
}

/* ===== تحسين أداء الأنيميشن =====
   المشكلة: gradientShift بيحرّك background-position و photoGlow بيحرّك
   box-shadow — الاتنين مش بيشتغلوا على كارت الشاشة، فالمعالج بيعيد رسم
   الشاشة كلها 60 مرة في الثانية. على الموبايل ده بيعلّق وياكل البطارية.
   transform و opacity بس هما اللي بيشتغلوا على الكارت. */

/* نقول للمتصفح يحجز طبقة للقلوب — بيمنع إعادة الرسم */
.float-item {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* على الموبايل: نقلل القلوب ونوقف الأنيميشن التقيلة */
@media (max-width: 820px) {
  /* نسيب أول 10 قلوب بس بدل 24 */
  .float-item:nth-child(n+11) { display: none; }
  /* التدرج المتحرك: بيرسم الشاشة كلها كل فريم */
  body { animation: none !important; background-size: 100% 100% !important; }
  /* توهج الصورة: box-shadow متحرك = إعادة رسم كاملة */
  .photo-circle img, .photo-circle { animation: none !important; }
  /* الضبابية تقيلة على معالج الموبايل */
  * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}

/* احترام إعداد "تقليل الحركة" في نظام المستخدم */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
