/* تَكّة — صفحات الدخول والتسجيل — هوية «ومضة» */
@import url('takkah-brand.css');

/* ——— أساس ——— */
.fi-simple-layout {
    display: grid !important;
    min-height: 100dvh;
    min-height: 100svh;
    background: var(--takkah-light);
    align-items: stretch !important;
    justify-content: stretch !important;
}

.fi-simple-main-ctn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    flex-grow: 0 !important;
}

.fi-simple-main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 32rem !important;
    background: transparent !important;
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-shadow: 0 0 #0000 !important;
}

.fi-simple-page {
    padding: 0;
    width: 100%;
}

/* ——— ترويسة الجوال ——— */
.takkah-auth-mobile-head {
    display: none;
    direction: rtl;
    text-align: center;
    color: #fff;
    background: linear-gradient(180deg, var(--takkah-dark) 0%, var(--takkah-dark-soft) 100%);
    padding: calc(env(safe-area-inset-top, 0px) + 1.25rem) 1.25rem 1.5rem;
}

.takkah-auth-mobile-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    text-decoration: none;
    color: #fff;
}

.takkah-auth-mobile-logo img {
    width: 3rem;
    height: 3rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.takkah-auth-mobile-logo span {
    font-size: 1.75rem;
    font-weight: 900;
}

.takkah-auth-mobile-tag {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--takkah-primary);
    line-height: 1.5;
}

/* ——— اللوحة الجانبية (كمبيوتر) ——— */
.takkah-auth-brand {
    position: relative;
    display: none;
    overflow: hidden;
    background: linear-gradient(145deg, var(--takkah-dark) 0%, var(--takkah-dark-soft) 100%);
    color: #fff;
    direction: rtl;
}

@media (min-width: 1024px) {
    .fi-simple-layout {
        grid-template-columns: minmax(0, 1.15fr) minmax(28rem, 34rem);
    }

    .takkah-auth-mobile-head {
        display: none !important;
    }

    .takkah-auth-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        grid-column: 1;
        grid-row: 1;
    }

    .fi-simple-main-ctn {
        grid-column: 2;
        grid-row: 1;
        padding: 2.5rem 2rem;
        background: var(--takkah-light);
    }

    .fi-simple-main {
        max-width: 34rem !important;
    }

    .fi-simple-header .fi-logo {
        display: none;
    }
}

.takkah-auth-brand-glow {
    position: absolute;
    border-radius: 9999px;
    filter: blur(80px);
    pointer-events: none;
}

.takkah-auth-brand-glow--1 {
    top: -6rem;
    right: -4rem;
    width: 22rem;
    height: 22rem;
    background: var(--takkah-primary);
    opacity: 0.35;
}

.takkah-auth-brand-glow--2 {
    bottom: -4rem;
    left: -2rem;
    width: 16rem;
    height: 16rem;
    background: var(--takkah-primary-soft);
    opacity: 0.2;
}

.takkah-auth-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 30rem;
    padding: 2.5rem 2rem;
    text-align: right;
}

.takkah-auth-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    text-decoration: none;
    color: #fff;
}

.takkah-auth-brand-logo img {
    width: 3.5rem;
    height: 3.5rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.takkah-auth-brand-logo span {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.takkah-auth-brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 107, 53, 0.35);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--takkah-primary);
}

.takkah-auth-brand-title {
    margin: 0;
    font-size: clamp(1.625rem, 2.5vw, 2.125rem);
    font-weight: 900;
    line-height: 1.35;
}

.takkah-auth-brand-desc {
    margin: 1rem 0 0;
    font-size: 1rem;
    line-height: 1.7;
    opacity: 0.88;
}

.takkah-auth-brand-features {
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.takkah-auth-brand-features li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.takkah-auth-brand-features li::before {
    content: '';
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--takkah-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.25);
}

.takkah-auth-brand-home {
    display: inline-block;
    margin-top: 2rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--takkah-primary-soft);
    text-decoration: none;
    transition: color 0.15s ease;
}

.takkah-auth-brand-home:hover {
    color: #fff;
}

/* ——— الجوال: تخطيط عمودي قابل للتمرير ——— */
@media (max-width: 1023px) {
    .fi-simple-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .takkah-auth-mobile-head {
        display: block;
        grid-row: 1;
    }

    .fi-simple-main-ctn {
        grid-row: 2;
        align-items: flex-start !important;
        justify-content: center !important;
        min-height: 0;
        padding: 1rem 1rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
        background: var(--takkah-light) !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .fi-simple-main {
        max-width: 100% !important;
    }

    /* إخفاء الشعار المكرر داخل البطاقة — يظهر في الترويسة العلوية */
    .fi-simple-header .fi-logo {
        display: none;
    }
}

/* ——— بطاقة النموذج ——— */
.fi-simple-page-content {
    width: 100%;
    box-sizing: border-box;
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 1.25rem;
    background: #fff;
    border: 1px solid rgba(20, 20, 31, 0.06);
    box-shadow:
        0 4px 6px rgba(20, 20, 31, 0.04),
        0 20px 50px rgba(20, 20, 31, 0.08);
}

@media (max-width: 1023px) {
    .fi-simple-page-content {
        padding: 1.5rem 1.25rem 1.25rem;
        border-radius: 1.125rem;
    }
}

@media (min-width: 1024px) {
    .fi-simple-page-content {
        padding: 2rem 1.75rem 1.75rem;
    }
}

/* ——— الترويسة ——— */
.fi-simple-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.fi-simple-header .fi-logo {
    margin: 0 auto 1rem;
}

.fi-simple-header .fi-logo img {
    height: 3.25rem !important;
}

.fi-simple-header-heading {
    font-size: 1.5rem !important;
    font-weight: 900 !important;
    color: var(--takkah-dark) !important;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

@media (min-width: 1024px) {
    .fi-simple-header-heading {
        font-size: 1.625rem !important;
    }
}

.fi-simple-header-subheading {
    margin-top: 0.65rem !important;
    font-size: 0.9375rem !important;
    color: #6b7280 !important;
    line-height: 1.65;
}

.fi-simple-header-subheading a {
    color: var(--takkah-primary) !important;
    font-weight: 700;
}

/* ——— النموذج ——— */
.fi-simple-page .fi-sc-form,
.fi-simple-page .fi-sc.fi-grid,
.fi-simple-page .fi-grid-col,
.fi-simple-page .fi-sc-component {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.fi-simple-page .fi-fo-field {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.45rem !important;
    width: 100% !important;
    grid-template-columns: none !important;
    margin-bottom: 0.35rem;
}

.fi-simple-page .fi-fo-field-label-col,
.fi-simple-page .fi-fo-field-content-col {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    grid-template-columns: none !important;
}

.fi-simple-page .fi-fo-field-label-ctn,
.fi-simple-page .fi-fo-field-label {
    display: block !important;
    width: 100% !important;
}

.fi-simple-page .fi-fo-field-label-content {
    display: block;
    text-align: right;
    font-weight: 700 !important;
    color: var(--takkah-dark-soft) !important;
    font-size: 0.9375rem !important;
}

.fi-simple-page .fi-input-wrp {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 3rem;
    box-sizing: border-box;
    border-radius: 0.875rem !important;
    border: 1px solid #e5e7eb !important;
    background: #fafafa !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (max-width: 1023px) {
    .fi-simple-page .fi-input-wrp {
        min-height: 3.25rem;
    }
}

.fi-simple-page .fi-input-wrp:focus-within {
    border-color: var(--takkah-primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.18) !important;
}

.fi-simple-page .fi-input-wrp-content-ctn {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.fi-simple-page .fi-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    border: none !important;
    background: transparent !important;
    padding: 0.8rem 1rem !important;
    font-size: 1rem !important;
    text-align: right;
    min-height: 2.75rem;
    color: var(--takkah-dark, #14141f) !important;
    -webkit-text-fill-color: var(--takkah-dark, #14141f) !important;
    caret-color: var(--takkah-primary, #ff6b35) !important;
}

.fi-simple-page .fi-input::placeholder {
    color: #9ca3af !important;
    -webkit-text-fill-color: #9ca3af !important;
    opacity: 1;
}

.fi-simple-page .fi-input::selection {
    background: rgba(255, 107, 53, 0.25);
    color: var(--takkah-dark, #14141f) !important;
}


@media (max-width: 1023px) {
    .fi-simple-page .fi-input {
        font-size: 16px !important; /* يمنع تكبير iOS التلقائي */
        padding: 0.85rem 1rem !important;
        min-height: 3rem;
    }
}

.fi-simple-page .fi-input:-webkit-autofill,
.fi-simple-page .fi-input:-webkit-autofill:hover,
.fi-simple-page .fi-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fafafa inset !important;
    -webkit-text-fill-color: var(--takkah-dark) !important;
    transition: background-color 9999s ease-out;
}

/* زر إظهار كلمة المرور — مساحة لمس أكبر */
.fi-simple-page .fi-input-wrp-suffix {
    padding-inline: 0.65rem;
}

.fi-simple-page .fi-icon-btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
}

/* خانة الموافقة — بجانب النص (تجاوز display:block العام على حقول النموذج) */
.fi-simple-page .fi-fo-field:has(.fi-checkbox-input) {
    margin-top: 0.35rem;
}

.fi-simple-page .fi-fo-field:has(.fi-checkbox-input) .fi-fo-field-label-col {
    width: 100% !important;
}

.fi-simple-page .fi-fo-field:has(.fi-checkbox-input) .fi-fo-field-label-ctn,
.fi-simple-page .fi-fo-field:has(.fi-checkbox-input) .fi-fo-field-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
    width: 100% !important;
    cursor: pointer;
}

.fi-simple-page .fi-fo-field:has(.fi-checkbox-input) .fi-fo-field-label-content {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    text-align: right;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    line-height: 1.65 !important;
    color: #4b5563 !important;
}

.fi-simple-page .fi-fo-field:has(.fi-checkbox-input) .fi-checkbox-input {
    width: 1.125rem !important;
    height: 1.125rem !important;
    margin-top: 0.2rem !important;
    flex-shrink: 0 !important;
    accent-color: var(--takkah-primary);
}

.fi-simple-page .fi-fo-field:has(.fi-checkbox-input) .takkah-legal-link {
    color: var(--takkah-primary);
    font-weight: 700;
    text-decoration: none;
}

.fi-simple-page .fi-fo-field:has(.fi-checkbox-input) .takkah-legal-link:hover {
    text-decoration: underline;
}

.fi-simple-page .fi-btn.fi-color-primary {
    width: 100%;
    min-height: 3rem;
    border-radius: 9999px !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
    padding-block: 0.8rem !important;
    background-color: var(--takkah-primary) !important;
    color: var(--takkah-dark) !important;
    box-shadow: 0 4px 14px rgba(255, 107, 53, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

@media (max-width: 1023px) {
    .fi-simple-page .fi-btn.fi-color-primary {
        min-height: 3.25rem;
        font-size: 1.0625rem !important;
    }
}

.fi-simple-page .fi-btn.fi-color-primary:hover {
    background-color: var(--takkah-primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 107, 53, 0.4);
}

.fi-simple-page .fi-ac-actions {
    margin-top: 1rem;
    width: 100%;
}

.fi-simple-page .fi-ac-btn-action {
    width: 100%;
}

.fi-simple-page .fi-sc-has-gap {
    gap: 1.125rem !important;
}

/* رسائل التحقق من كلمة المرور في التسجيل */
.fi-simple-page .fi-fo-field-wrp-error-message,
.fi-simple-page .fi-fo-field-wrp-error-list {
    text-align: right;
    font-size: 0.8125rem;
}

/* مبدّل الثيم في صفحات الدخول */
.takkah-auth-theme-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* ─── الوضع الداكن — نفس Filament + بطاقة النموذج ─── */
.dark .fi-simple-layout {
    background: var(--takkah-surface-muted);
}

.dark .fi-simple-main-ctn {
    background: var(--takkah-surface-muted) !important;
}

.dark .fi-simple-page-content {
    background: var(--takkah-surface);
    border: none;
    box-shadow:
        0 1px 2px 0 rgb(0 0 0 / 0.05),
        0 0 0 1px rgb(255 255 255 / 0.1);
}

.dark .fi-simple-header-heading {
    color: var(--takkah-heading) !important;
}

.dark .fi-simple-header-subheading {
    color: var(--takkah-muted) !important;
}

.dark .fi-simple-page .fi-fo-field-label-content {
    color: var(--takkah-heading) !important;
}

.dark .fi-simple-page .fi-input-wrp {
    background: var(--takkah-input-bg) !important;
    border-color: var(--takkah-input-border) !important;
}

.dark .fi-simple-page .fi-input {
    color: var(--takkah-heading) !important;
    -webkit-text-fill-color: var(--takkah-heading) !important;
}

.dark .fi-simple-page .fi-input::placeholder {
    color: var(--takkah-muted) !important;
    -webkit-text-fill-color: var(--takkah-muted) !important;
}

.dark .fi-simple-page .fi-input:-webkit-autofill,
.dark .fi-simple-page .fi-input:-webkit-autofill:hover,
.dark .fi-simple-page .fi-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--takkah-input-bg) inset !important;
    -webkit-text-fill-color: var(--takkah-heading) !important;
}

.dark .fi-simple-page .fi-fo-field:has(.fi-checkbox-input) .fi-fo-field-label-content {
    color: var(--takkah-body) !important;
}
