@font-face { font-family: Cairo; src: url('fonts/Cairo-Regular.woff2') format('woff2'), url('fonts/Cairo-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Cairo; src: url('fonts/Cairo-SemiBold.woff2') format('woff2'), url('fonts/Cairo-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: Cairo; src: url('fonts/Cairo-Bold.woff2') format('woff2'), url('fonts/Cairo-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --brand: #17324d;
  --brand-dark: #0b2238;
  --brand-soft: #e7eff0;
  --orange: #0f766e;
  --orange-soft: #e7f3f1;
  --ink: #101820;
  --muted: #56636d;
  --line: #d4dfe2;
  --paper: #ffffff;
  --canvas: #f6f7f2;
  --success: #2e7d5b;
  --danger: #b4233f;
  --shadow: 0 22px 70px rgba(11, 34, 56, .09);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 16px/1.55 Cairo, Arial, sans-serif; }
html[dir='rtl'] body { font-family: Cairo, Tahoma, Arial, sans-serif; }
button, input, a { -webkit-tap-highlight-color: transparent; }
a, button { touch-action: manipulation; }
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; transform: translateY(-150%); border-radius: 8px; padding: 10px 14px; background: var(--ink); color: #fff; text-decoration: none; transition: transform 160ms ease; }
.skip-link:focus { transform: translateY(0); }

.topbar { display: flex; min-height: 84px; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); padding: 14px clamp(20px, 5vw, 72px); background: rgba(255, 255, 255, .88); backdrop-filter: blur(14px); }
.brand { display: inline-flex; min-height: 48px; align-items: center; gap: 17px; text-decoration: none; }
.brand img { display: block; width: 154px; height: auto; }
.brand-divider { width: 1px; height: 27px; background: var(--line); }
.brand-product { color: var(--brand-dark); font-size: 13px; font-weight: 700; letter-spacing: .03em; }
.account { display: flex; align-items: center; gap: 16px; }
.account-copy { display: grid; text-align: right; }
.account-copy strong { font-size: 13px; }
.account-copy small { color: var(--muted); font-size: 11px; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 9px; padding: 10px 16px; cursor: pointer; font-weight: 700; text-decoration: none; transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease; }
.button:hover { transform: translateY(-1px); }
.button--quiet { border-color: var(--line); background: var(--paper); color: var(--brand-dark); font-size: 12px; }
.button--quiet:hover { border-color: var(--brand); background: var(--brand-soft); }
.button--primary { background: var(--brand); color: #fff; }
.button--primary:hover { background: var(--brand-dark); }
.button--wide { width: 100%; margin-top: 10px; }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: end; gap: clamp(40px, 8vw, 110px); padding: clamp(70px, 10vw, 132px) 0 clamp(58px, 8vw, 96px); }
.eyebrow { margin: 0 0 14px; color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { max-width: 850px; margin: 0; font-size: clamp(44px, 7vw, 86px); font-weight: 600; letter-spacing: -.055em; line-height: .98; }
.hero h1 span { color: var(--brand); }
.hero-description { max-width: 720px; margin: 30px 0 0; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.7; }
.hero-summary { display: grid; min-height: 208px; align-content: space-between; border-top: 4px solid var(--orange); padding: 18px 0 4px; }
.summary-label, .summary-detail { color: var(--muted); font-size: 12px; }
.hero-summary strong { color: var(--brand-dark); font-size: 72px; font-weight: 600; letter-spacing: -.06em; line-height: 1; }

.documents-section { padding: 0 0 72px; }
.company-setting-card { display: grid; grid-template-columns: auto auto minmax(260px, 1fr) auto auto; align-items: center; gap: 24px; margin-bottom: 72px; border: 1px solid #d9cede; border-radius: var(--radius); padding: 26px 28px; background: var(--brand-soft); }
.company-setting-card__number { align-self: start; color: var(--brand); font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.company-setting-card__logo { display: grid; width: 88px; height: 72px; place-items: center; border-radius: 13px; padding: 12px; background: #fff; }
.company-setting-card__logo img { display: block; width: 100%; max-height: 48px; object-fit: contain; }
.company-setting-card__copy .eyebrow { margin-bottom: 4px; }
.company-setting-card__copy h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.company-setting-card__copy > p:last-child { max-width: 610px; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.company-setting-card__status { display: grid; min-width: 130px; gap: 2px; border-inline-start: 1px solid #d4c8d9; padding-inline-start: 24px; }
.company-setting-card__status span { color: var(--muted); font-size: 10px; }
.company-setting-card__status strong { font-size: 13px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); padding: 0 0 22px; }
.section-heading .eyebrow { margin-bottom: 7px; }
.section-heading h2 { margin: 0; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.035em; }
.section-count { color: var(--muted); font-size: 12px; }
.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding-top: 24px; }
.document-card { position: relative; display: flex; min-height: 470px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: var(--paper); box-shadow: 0 1px 0 rgba(50, 25, 65, .02); transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.document-card:hover { border-color: #c8bdce; box-shadow: var(--shadow); transform: translateY(-4px); }
.document-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: var(--brand); }
.document-card--orange::before { background: var(--orange); }
.document-card--future::before { background: #aca3b1; }
.document-card--future { background: linear-gradient(145deg, #fff, #f3f0f4); }
.document-card__top { display: flex; align-items: center; justify-content: space-between; }
.document-number { color: #aaa1ae; font-size: 12px; font-weight: 700; letter-spacing: .13em; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-size: 11px; font-weight: 700; }
.status span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(25, 114, 74, .1); }
.status--planned { border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); }
.document-icon { display: grid; width: 58px; height: 58px; place-items: center; margin: 48px 0 26px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }
.document-card--orange .document-icon { background: var(--orange-soft); color: #b74b19; }
.document-card--future .document-icon { background: #e9e5eb; color: #766c7c; }
.document-icon svg, .card-action svg, .system-note svg { width: 26px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.document-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.document-title-row h3 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.document-title-row > span { color: var(--brand); font-family: Cairo, sans-serif; font-size: 15px; font-weight: 600; }
.document-card > p { margin: 15px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.document-meta { margin-bottom: 28px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.card-action { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; border-top: 1px solid var(--line); padding-top: 20px; color: var(--brand-dark); font-size: 13px; font-weight: 700; text-decoration: none; }
.card-action svg { width: 21px; transition: transform 160ms ease; }
.card-action:hover svg { transform: translateX(4px); }
.document-card--orange .card-action { color: #9d3d13; }
.card-action--disabled { color: var(--muted); cursor: default; }

.system-note { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; margin-bottom: 70px; border: 1px solid #d9cede; border-radius: 15px; padding: 24px 28px; background: var(--brand-soft); }
.system-note__icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: var(--paper); color: var(--brand); }
.system-note h2 { margin: 0 0 3px; font-size: 15px; }
.system-note p { margin: 0; color: var(--muted); font-size: 13px; }
footer { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 18px clamp(20px, 5vw, 72px); color: var(--muted); font-size: 11px; }

.login-page { min-height: 100dvh; background: var(--paper); }
.login-shell { display: grid; width: 100%; min-height: 100dvh; grid-template-columns: minmax(360px, .95fr) minmax(440px, 1.05fr); }
.login-aside { position: relative; display: flex; min-height: 100%; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(42px, 6vw, 90px); background: var(--brand-dark); color: #fff; }
.login-aside::before { content: ''; position: absolute; inset: 0; opacity: .1; background: url('brand/brand-pattern.svg') center/680px auto; }
.login-aside > * { position: relative; z-index: 1; }
.login-aside img { width: 190px; margin-bottom: clamp(70px, 14vh, 150px); filter: brightness(0) invert(1); }
.login-aside .eyebrow { color: #e3c9f1; }
.login-aside h1 { max-width: 620px; margin: 0; font-size: clamp(42px, 5vw, 73px); font-weight: 600; letter-spacing: -.055em; line-height: 1; }
.login-aside p:not(.eyebrow) { max-width: 560px; margin: 26px 0 0; color: #dacfe0; font-size: 16px; line-height: 1.75; }
.login-aside__footer { color: #cabbd2; font-family: Cairo, sans-serif; font-size: 12px; }
.login-card { width: min(460px, calc(100% - 48px)); align-self: center; justify-self: center; padding: 48px 42px; }
.login-card__mark { display: flex; gap: 5px; margin-bottom: 58px; }
.login-card__mark span { display: block; width: 28px; height: 5px; background: var(--brand); }
.login-card__mark span:nth-child(2) { width: 14px; background: var(--orange); }
.login-card__mark span:nth-child(3) { width: 6px; background: #c0b7c5; }
.login-language { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; color: var(--brand); font-size: 12px; font-weight: 700; text-decoration: none; }
.login-card .eyebrow { margin-bottom: 8px; }
.login-card h2 { margin: 0; font-size: 38px; letter-spacing: -.04em; }
.login-subtitle { margin: 8px 0 34px; color: var(--muted); font-size: 14px; }
.login-card label { display: block; margin: 18px 0 7px; color: var(--ink); font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px; background: #fff; color: var(--ink); font-size: 16px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.login-card input:hover { border-color: #b8aebe; }
.login-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); outline: none; }
.login-card textarea { display: block; width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.5; resize: vertical; transition: border-color 160ms ease, box-shadow 160ms ease; }
.login-card textarea:hover { border-color: #b8aebe; }
.login-card textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); outline: none; }
.login-card [aria-invalid='true'] { border-color: var(--danger); }
.login-card .form-alert p { margin: 0; }
.login-card .form-alert p + p { margin-top: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-alert { border-inline-start: 4px solid var(--danger); padding: 10px 12px; background: #fff1f3; color: var(--danger); font-size: 12px; }
.form-alert code { overflow-wrap: anywhere; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 0; color: var(--muted); font-size: 13px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-signup { display: grid; gap: 4px; margin-top: 16px; text-align: center; }
.login-signup p { margin: 0; color: var(--ink); font-size: 15px; font-weight: 700; }
.button--outline { gap: 10px; min-height: 52px; border-color: var(--brand); background: #fff; color: var(--brand); font-size: 16px; }
.button--outline:hover { background: var(--brand); color: #fff; }
.button--outline svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.login-help { margin: 17px 0 0; color: var(--muted); font-family: Cairo, sans-serif; font-size: 12px; text-align: center; }

.settings-main { padding: clamp(64px, 8vw, 108px) 0 84px; }
.settings-heading { max-width: 800px; margin-bottom: 48px; }
.settings-heading h1 { margin: 0; font-size: clamp(42px, 6vw, 74px); font-weight: 600; letter-spacing: -.055em; line-height: 1; }
.settings-heading h1 span { color: var(--brand); }
.settings-heading > p:last-child { max-width: 680px; margin: 24px 0 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.settings-notice { display: grid; gap: 3px; margin-bottom: 22px; border: 1px solid; border-radius: 12px; padding: 16px 18px; font-size: 13px; }
.settings-notice--success { border-color: #a8d7bf; background: #eefaf3; color: #145a3a; }
.settings-notice--error { border-color: #efb5be; background: #fff2f4; color: var(--danger); }
.settings-notice ul { margin: 7px 0 0; padding-inline-start: 20px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 24px; }
.settings-form { display: grid; gap: 18px; }
.settings-panel { border: 1px solid var(--line); border-radius: 16px; padding: 28px; background: var(--paper); }
.settings-panel__heading { display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: start; margin-bottom: 27px; border-bottom: 1px solid var(--line); padding-bottom: 19px; }
.settings-panel__heading > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; }
.settings-panel__heading h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.settings-panel__heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.settings-field { display: grid; align-content: start; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 700; }
.settings-field--wide { grid-column: 1 / -1; }
.settings-field > span small, .settings-field > span b { margin-inline-start: 5px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.settings-field > span b { color: var(--brand); }
.settings-field input:not([type='file']):not([type='color']):not([type='checkbox']), .settings-field textarea { display: block; width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fff; color: var(--ink); font: 400 16px/1.4 Cairo, sans-serif; transition: border-color 160ms ease, box-shadow 160ms ease; }
.settings-field textarea { min-height: 86px; resize: vertical; }
.settings-field input:hover, .settings-field textarea:hover { border-color: #b7acbc; }
.settings-field input:focus, .settings-field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); outline: none; }
.logo-upload { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; gap: 20px; border: 1px dashed #beb3c3; border-radius: 12px; padding: 18px; background: var(--canvas); }
.logo-preview { display: grid; min-height: 100px; place-items: center; border-radius: 9px; padding: 14px; background: #fff; }
.logo-preview img { display: block; max-width: 100%; max-height: 76px; object-fit: contain; }
.logo-upload input[type='file'] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-button { display: inline-flex; min-height: 44px; align-items: center; border: 1px solid var(--brand); border-radius: 8px; padding: 9px 14px; background: #fff; color: var(--brand); cursor: pointer; font-size: 12px; font-weight: 700; }
.upload-button:hover { background: var(--brand-soft); }
.logo-upload p { margin: 9px 0 0; color: var(--muted); font-size: 11px; font-weight: 400; }
.remove-logo { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--danger); font-size: 11px; font-weight: 600; }
.remove-logo input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--danger); }
.settings-grid--colors { max-width: 620px; }
.color-field { display: grid; grid-template-columns: 1fr 52px; gap: 8px; }
.color-field input[type='color'] { width: 52px; height: 46px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; cursor: pointer; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0 0; }
.settings-actions > span { margin-inline-start: auto; color: var(--muted); font-size: 11px; }
.company-preview { position: sticky; top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; padding: 24px; background: #fff; box-shadow: var(--shadow); }
.company-preview::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--brand) 0 72%, var(--orange) 72%); }
.company-preview__logo { display: grid; min-height: 92px; place-items: center; margin: 4px 0 20px; border-radius: 10px; padding: 14px; background: var(--canvas); }
.company-preview__logo img { display: block; max-width: 100%; max-height: 64px; object-fit: contain; }
.company-preview h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; overflow-wrap: anywhere; }
.company-preview > p:not(.eyebrow) { margin: 7px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.company-preview dl { display: grid; gap: 10px; margin: 0; border-top: 1px solid var(--line); padding-top: 18px; }
.company-preview dl div { display: grid; grid-template-columns: 82px 1fr; gap: 8px; }
.company-preview dt { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.company-preview dd { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.company-preview__colors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }
.company-preview__colors span { display: flex; min-height: 58px; align-items: end; border-radius: 8px; padding: 7px; }
.company-preview__colors b { border-radius: 4px; padding: 3px 5px; background: rgba(255,255,255,.9); color: #19161d; font-size: 8px; }

@media (max-width: 900px) {
  .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-card--future { grid-column: 1 / -1; min-height: 390px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-card { margin: 48px auto; }
  .company-setting-card { grid-template-columns: auto 88px minmax(0, 1fr); }
  .company-setting-card__status { grid-column: 2 / 4; border-inline-start: 0; padding-inline-start: 0; }
  .company-setting-card > .button { grid-column: 2 / 4; }
  .settings-layout { grid-template-columns: 1fr; }
  .company-preview { position: static; grid-row: 1; }
}

@media (max-width: 680px) {
  .topbar { min-height: 70px; padding: 10px 16px; }
  .brand { gap: 10px; }
  .brand img { width: 120px; }
  .brand-divider, .account-copy { display: none; }
  .brand-product { font-size: 11px; }
  .button--quiet { min-height: 44px; padding: 9px 12px; }
  .account { gap: 7px; }
  .topbar-settings { display: none; }
  main { width: min(100% - 28px, 1180px); }
  .hero { grid-template-columns: 1fr; gap: 38px; padding: 62px 0 58px; }
  .hero h1 { font-size: clamp(42px, 13vw, 62px); }
  .hero-summary { min-height: 150px; grid-template-columns: 1fr auto; align-items: center; }
  .hero-summary strong { grid-row: 1 / span 2; grid-column: 2; }
  .document-grid { grid-template-columns: 1fr; }
  .document-card, .document-card--future { min-height: 430px; grid-column: auto; padding: 24px; }
  .company-setting-card { grid-template-columns: 1fr; gap: 18px; margin-bottom: 58px; padding: 22px; }
  .company-setting-card__logo { width: 100%; }
  .company-setting-card__status, .company-setting-card > .button { grid-column: auto; }
  .company-setting-card__status { border-inline-start: 0; border-top: 1px solid #d4c8d9; padding: 14px 0 0; }
  .section-heading { align-items: start; }
  .section-count { padding-top: 8px; }
  .system-note { align-items: start; padding: 20px; }
  footer { padding: 18px 16px; }
  .login-card { width: min(100% - 28px, 460px); padding: 34px 18px; }
  .settings-main { padding-top: 56px; }
  .settings-heading h1 { font-size: clamp(40px, 13vw, 58px); }
  .settings-layout { gap: 16px; }
  .settings-panel { padding: 22px 18px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-field--wide { grid-column: auto; }
  .logo-upload { grid-template-columns: 1fr; }
  .settings-actions .button { width: 100%; }
  .settings-actions > span { width: 100%; margin-inline-start: 0; text-align: center; }
}

html[dir='rtl'] .account-copy { text-align: left; }
html[dir='rtl'] .eyebrow, html[dir='rtl'] .document-number, html[dir='rtl'] .document-meta, html[dir='rtl'] .company-setting-card__number { letter-spacing: 0; }
html[dir='rtl'] .hero h1, html[dir='rtl'] .settings-heading h1, html[dir='rtl'] .login-aside h1, html[dir='rtl'] .login-card h2, html[dir='rtl'] .section-heading h2, html[dir='rtl'] .document-title-row h3 { letter-spacing: 0; line-height: 1.2; }
html[dir='rtl'] .card-action svg { transform: scaleX(-1); }
html[dir='rtl'] .card-action:hover svg { transform: scaleX(-1) translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
