/* --- [ 1. الإعدادات الأساسية والخطوط ] --- */
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
  --primary: #ff6b35;
  --primary-light: #ff8c5f;
  --secondary: #1a936f;
  --secondary-light: #2bb58d;
  --accent: #114b5f;
  --accent-light: #1c6a8a;
  --light: #f9f7f3;
  --dark: #2a2d34;
  --ios-bg: #f2f2f7; /* لون خلفية نظام iOS */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  -webkit-tap-highlight-color: transparent; /* إزالة الوميض الأزرق عند اللمس في آيفون */
}

body {
  background-color: var(--light);
  width: 100%;
  height: 100vh;
  overflow: hidden;
    overscroll-behavior-y: contain; /* منع سحب الصفحة لتحديثها مثل المتصفح */
    user-select: none; /* منع تحديد النصوص (إلا في الـ inputs) */
    -webkit-tap-highlight-color: transparent; /* إزالة الوميض الرمادي عند النقر */
}
/* تحسين شكل السكرول بار ليختفي مثل التطبيقات */
::-webkit-scrollbar {
    display: none;
}
html, body {
    overscroll-behavior-y: none; /* يمنع المتصفح من عمل تحديث تلقائي عند السحب */
    height: 100%;
    overflow-x: hidden;
}
/* --- [ 2. نظام التنبيهات (Flash Messages) - نمط iOS Toast ] --- */
.flash-container {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%); /* التوسيط في المنتصف علوياً */
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 380px;
    pointer-events: none;
}

.flash-box {
    width: fit-content;
    min-width: 200px;
    max-width: 90%;
    padding: 8px 16px; /* أنحف وأكثر أناقة */
    border-radius: 40px; /* شكل الكبسولة الأيفوني */
    background: rgba(255, 255, 255, 0.85); /* لون داكن شفاف (Dark Mode iOS) */
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2bb58d;
    font-size: 14px;
    font-weight: 600;
    pointer-events: auto;
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    
    /* حركة دخول مطاطية (Spring Animation) */
    animation: iosBounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
/* أيقونة الحالة داخل الإشعار */
.flash-box::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}
.flash-container.error .flash-box { border-bottom: 3px solid #ff3b30; }
.flash-container.success .flash-box { border-bottom: 3px solid #34c759; }

.flash-box i { font-size: 22px; }
.flash-container.error i { color: #ff3b30; }
.flash-container.success i { color: #34c759; }

.flash-box span {
    color: var(--dark);
    font-size: 14px;
    font-weight: 600;
}

/* --- [ 3. الحاوية الرئيسية واللوحات ] --- */
.auth-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle at top right, #ffffff, var(--light));
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 40px; /* انحناء آيفون فائق */
    padding: 45px 35px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.06);
    border: 1px solid rgba(255,255,255,0.7);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-panel { width: 100%; }

.brand-logo-ios {
    text-align: center;
    margin-bottom: 25px;
}

.brand-logo-ios img {
    width: 75px;
    filter: drop-shadow(0 8px 15px rgba(255, 107, 53, 0.2));
}

.login-panel h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: -0.5px;
}

/* --- [ 4. الحقول العائمة (Floating Inputs) ] --- */
.form-group.floating {
    position: relative;
    margin-bottom: 18px;
    background: var(--ios-bg);
    border-radius: 18px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.form-group.floating:focus-within {
    background: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

.form-group.floating input {
    width: 100%;
    padding: 26px 15px 10px 50px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: var(--dark);
    outline: none;
}

.form-group.floating label {
    position: absolute;
    left: 50px;
    top: 18px;
    color: #8e8e93;
    font-size: 15px;
    transition: 0.25s ease all;
    pointer-events: none;
}

/* حركة التسمية عند التركيز */
.form-group.floating input:focus ~ label,
.form-group.floating input:not(:placeholder-shown) ~ label {
    top: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 52%;
    transform: translateY(-50%);
    color: #aeaeb2;
    font-size: 18px;
}

.password-toggle {
    position: absolute;
    right: 18px;
    top: 52%;
    transform: translateY(-50%);
    color: #aeaeb2;
    cursor: pointer;
    padding: 5px;
    transition: 0.3s;
}

.password-toggle:hover { color: var(--primary); }

/* --- [ 5. الأزرار والروابط ] --- */
.form-footer {
    text-align: right;
    margin-bottom: 25px;
}

.ios-link {
    color: #8e8e93;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.3s;
}

.ios-link:hover { color: var(--primary); }

.btn-login {
    width: 100%;
    height: 60px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(255, 107, 53, 0.25);
    transition: var(--transition);
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 107, 53, 0.35);
}

.btn-login:active { transform: scale(0.96); }

/* --- [ 6. معلومات الأمان والتحويل ] --- */
.ios-switch-account {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
    color: #8e8e93;
}

.ios-switch-account a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    margin-left: 5px;
}

.security-info {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #f2f2f7;
    color: #aeaeb2;
    font-size: 12px;
}

/* --- [ 7. الحركات (Animations) ] --- */
@keyframes slideInDown {
    from { opacity: 0; transform: translate(-50%, -100px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- [ 8. التجاوب مع الجوال ] --- */
@media (max-width: 480px) {
    .login-container {
        padding: 35px 25px;
        border-radius: 35px;
    }
    .login-panel h1 { font-size: 24px; }
}