@font-face {
    font-family: 'droid_naskh';
    src: url('/font/droid_naskh.woff2') format('woff2'),
        url('/font/droid_naskh.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'GESSTwoLight-Light';
    src: url('/font/ge-ss-two/GESSTwoLight-Light.woff') format('woff'),
        url('/font/ge-ss-two/GESSTwoLight-Light.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --home-bg: #f3f5f8;
    --home-bg-accent: #e9eef5;
    --home-surface: #ffffff;
    --home-surface-2: #f7f9fc;
    --home-border: #e2e8f0;
    --home-text: #1f2937;
    --home-text-soft: #64748b;
    --home-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
    --home-shadow-hover: 0 4px 12px rgba(15, 23, 42, .1), 0 16px 40px rgba(15, 23, 42, .12);
    --home-radius: 16px;
    --home-font: droid_naskh, 'Segoe UI', Tahoma, sans-serif;
    --home-font-title: 'GESSTwoLight-Light', droid_naskh, 'Segoe UI', Tahoma, sans-serif;

    --c-admin: #34495e;
    --c-blue: #2563eb;
    --c-green: #16a34a;
    --c-red: #dc2626;
    --c-teal: #0f6c58;
    --c-neutral: #64748b;
}

html.dark {
    --home-bg: #0b1120;
    --home-bg-accent: #0f172a;
    --home-surface: #111827;
    --home-surface-2: #0f1626;
    --home-border: #1f2a3c;
    --home-text: #e5edf7;
    --home-text-soft: #94a3b8;
    --home-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .45);
    --home-shadow-hover: 0 6px 18px rgba(0, 0, 0, .5), 0 18px 44px rgba(0, 0, 0, .55);

    --c-admin: #7c93ac;
    --c-blue: #60a5fa;
    --c-green: #4ade80;
    --c-red: #f87171;
    --c-teal: #2dd4bf;
    --c-neutral: #94a3b8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    direction: rtl;
    font-family: var(--home-font);
    color: var(--home-text);
    background:
        radial-gradient(1200px 600px at 100% -10%, var(--home-bg-accent), transparent 60%),
        var(--home-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.home-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 28px 16px 64px;
}

/* ---------- Theme toggle ---------- */
.home-theme-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 50;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--home-border);
    background: var(--home-surface);
    color: var(--home-text-soft);
    box-shadow: var(--home-shadow);
    cursor: pointer;
    transition: color .15s, box-shadow .15s, transform .1s;
}

.home-theme-toggle:hover {
    color: var(--c-teal);
    transform: translateY(-1px);
    box-shadow: var(--home-shadow-hover);
}

/* ---------- Header ---------- */
.home-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 8px 0 22px;
}

.home-header img {
    width: 96px;
    height: auto;
}

.home-header h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.4;
    font-family: var(--home-font-title);
}

.home-header .home-sub {
    color: var(--home-text-soft);
    font-size: 15px;
}

.home-header .home-welcome {
    margin: 2px 0 0;
    color: var(--c-teal);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--home-font-title);
}

/* ---------- Search ---------- */
.home-search {
    position: relative;
    max-width: 620px;
    margin: 6px auto 30px;
}

.home-search input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--home-border);
    background: var(--home-surface);
    border-radius: 999px;
    padding: 0 54px 0 20px;
    font-family: inherit;
    font-size: 17px;
    color: var(--home-text);
    box-shadow: var(--home-shadow);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.home-search input:focus {
    border-color: var(--c-teal);
    box-shadow: 0 0 0 4px rgba(15, 108, 88, .15), var(--home-shadow);
}

.home-search svg {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: var(--home-text-soft);
    pointer-events: none;
}

.home-no-results {
    display: none;
    text-align: center;
    color: var(--home-text-soft);
    font-size: 17px;
    padding: 40px 0;
}

/* ---------- Pinned "most used" ---------- */
.home-pinned {
    margin-bottom: 18px;
}

.home-pinned[hidden] {
    display: none;
}

.home-pinned .home-section__body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2px 8px;
}

/* ---------- Grid & sections ---------- */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
    align-items: start;
}

.home-section {
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius);
    box-shadow: var(--home-shadow);
    overflow: hidden;
    transition: box-shadow .18s, transform .18s;
}

.home-section:hover {
    box-shadow: var(--home-shadow-hover);
}

.home-section__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--home-border);
}

.home-section__icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--sec-color, var(--c-neutral));
}

.home-section__icon svg {
    width: 22px;
    height: 22px;
}

.home-section__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    font-family: var(--home-font-title);
}

.home-section__body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.home-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--home-text);
    text-decoration: none;
    font-size: 15.5px;
    line-height: 1.6;
    transition: background .13s, color .13s;
}

.home-link::before {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sec-color, var(--c-neutral));
    opacity: .55;
}

.home-link:hover {
    background: var(--home-surface-2);
    color: var(--sec-color, var(--c-teal));
}

.home-link:hover::before {
    opacity: 1;
}

/* section colors */
.sec--admin { --sec-color: var(--c-admin); }
.sec--blue { --sec-color: var(--c-blue); }
.sec--green { --sec-color: var(--c-green); }
.sec--red { --sec-color: var(--c-red); }
.sec--teal { --sec-color: var(--c-teal); }
.sec--neutral { --sec-color: var(--c-neutral); }

/* ---------- Footer actions ---------- */
.home-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--home-border);
    background: var(--home-surface);
    color: var(--home-text);
    transition: background .15s, box-shadow .15s, transform .1s;
}

.home-btn:hover {
    box-shadow: var(--home-shadow);
    transform: translateY(-1px);
}

.home-btn--primary {
    background: var(--c-teal);
    border-color: var(--c-teal);
    color: #fff;
}

.home-btn--danger {
    color: var(--c-red);
    border-color: color-mix(in srgb, var(--c-red) 40%, var(--home-border));
}

/* ---------- Guest / landing ---------- */
.home-hero {
    text-align: center;
    padding: 40px 16px 30px;
}

.home-hero img {
    width: 120px;
    height: auto;
    margin-bottom: 14px;
}

.home-hero h1 {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.4;
    font-family: var(--home-font-title);
}

.home-hero p {
    max-width: 640px;
    margin: 0 auto 22px;
    color: var(--home-text-soft);
    font-size: 17px;
    line-height: 1.9;
}

.home-services {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.home-service {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-radius: 14px;
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    box-shadow: var(--home-shadow);
    color: var(--home-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: box-shadow .18s, transform .12s, color .12s;
}

.home-service:hover {
    box-shadow: var(--home-shadow-hover);
    transform: translateY(-2px);
    color: var(--c-teal);
}

.home-service__icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--c-teal);
}

.home-service__icon svg {
    width: 24px;
    height: 24px;
}

.home-btn--sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* ---------- Login page ---------- */
.login-wrap {
    max-width: 480px;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 32px);
    padding-top: 48px;
    padding-bottom: 48px;
}

.login-panel {
    width: 100%;
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius);
    box-shadow: var(--home-shadow);
    padding: 28px 24px 22px;
}

.login-logos {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.login-logos img {
    height: auto;
    max-height: 72px;
    object-fit: contain;
}

.login-logos__org {
    display: inline-flex;
    align-items: center;
}

.login-logo--dark {
    display: none;
}

html.dark .login-logo--light {
    display: none;
}

html.dark .login-logo--dark {
    display: block;
}

.login-header {
    text-align: center;
    margin-bottom: 22px;
}

.login-header h1 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--c-teal);
    font-family: var(--home-font-title);
}

.login-header p {
    margin: 0;
    color: var(--home-text-soft);
    font-size: 15px;
    line-height: 1.8;
}

.login-alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14.5px;
    line-height: 1.7;
}

.login-alert p {
    margin: 0;
}

.login-alert p + p {
    margin-top: 4px;
}

.login-alert a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.login-alert--warning {
    background: color-mix(in srgb, #d97706 12%, var(--home-surface));
    border: 1px solid color-mix(in srgb, #d97706 35%, var(--home-border));
    color: #b45309;
}

html.dark .login-alert--warning {
    color: #fbbf24;
}

.login-alert--error {
    background: color-mix(in srgb, var(--c-red) 10%, var(--home-surface));
    border: 1px solid color-mix(in srgb, var(--c-red) 35%, var(--home-border));
    color: var(--c-red);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field label {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--home-text);
}

.login-field input[type="text"],
.login-field input[type="password"],
.login-field input[type="email"] {
    width: 100%;
    height: 48px;
    border: 1.5px solid color-mix(in srgb, var(--home-text) 28%, var(--home-border));
    background: var(--home-surface);
    border-radius: 12px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 16px;
    color: var(--home-text);
    transition: border-color .15s, box-shadow .15s, background .15s;
}

html.dark .login-field input[type="text"],
html.dark .login-field input[type="password"],
html.dark .login-field input[type="email"] {
    border-color: color-mix(in srgb, var(--home-text) 35%, var(--home-border));
    background: var(--home-surface-2);
}

.login-field input:focus {
    outline: none;
    border-color: var(--c-teal);
    background: var(--home-surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-teal) 22%, transparent);
}

.login-field input[aria-invalid="true"] {
    border-color: color-mix(in srgb, var(--c-red) 70%, var(--home-border));
}

.login-field__error {
    color: var(--c-red);
    font-size: 13.5px;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 15px;
    color: var(--home-text-soft);
}

.login-remember input {
    width: 18px;
    height: 18px;
    accent-color: var(--c-teal);
}

.login-submit {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
    height: 50px;
}

.login-dev {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--home-border);
    text-align: center;
}

.login-dev__title {
    margin: 0 0 12px;
    color: var(--home-text-soft);
    font-size: 14px;
}

.login-dev__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.login-dev__links form {
    display: inline;
    margin: 0;
}

.login-back {
    margin-top: 18px;
    text-align: center;
}

.login-back a {
    color: var(--home-text-soft);
    text-decoration: none;
    font-size: 14.5px;
    transition: color .15s;
}

.login-back a:hover {
    color: var(--c-teal);
}

@media (max-width: 480px) {
    .home-grid { grid-template-columns: 1fr; }
    .home-header h1 { font-size: 22px; }
    .home-hero h1 { font-size: 24px; }
    .login-panel { padding: 22px 16px 18px; }
    .login-header h1 { font-size: 20px; }
    .login-logos img { max-height: 60px; }
}
