:root {
    --brand-primary: #0D0D0A;
    --brand-green-light: #78A86D;
    --brand-green-dark: #0A4724;
    --brand-green-medium: #245E35;
    --primary-light: #fffffffe;
    --brand-beige: #F3EBE3;
    --brand-teal: #86A49F;
    --text-primary: #0D0D0A;
    --text-secondary: #667178;
    --text-heading: #000001;
    --bg-light: #F8F9F9;
    --bg-white: #FFFFFF;
    --border: #E9EBEC;
    --danger: #C0392B;
    --success: #2E7D32;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
    background: var(--bg-light);
    color: var(--text-heading);
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
}

/* ---------------- Header / Footer ---------------- */

.landing-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
}

.landing-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.landing-brand-logo {
    height: 40px;
    width: auto;
}

.landing-brand-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-primary);
}

.landing-main {
    flex: 1;
    padding: 32px 16px;
}

.landing-footer {
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-white);
}

/* ---------------- Form page shell ---------------- */

.form-page {
    max-width: 1080px;
    margin: 0 auto;
}

.form-page-inner {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.form-page-title {
    font-size: 28px;
    color: var(--text-heading);
    margin: 0 0 8px;
    text-align: center;
}

.form-page-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 32px;
    font-size: 14px;
}

/* ---------------- Stepper ---------------- */

.stepper {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 90px;
    cursor: default;
}

.stepper-item.is-clickable {
    cursor: pointer;
}

.stepper-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
}

.stepper-item.is-active .stepper-circle {
    background: var(--brand-primary);
    color: #fff;
}

.stepper-item.is-done .stepper-circle {
    background: var(--brand-green-light);
    color: #fff;
}

.stepper-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stepper-item.is-active .stepper-label {
    color: var(--text-heading);
    font-weight: 600;
}

.stepper-divider {
    flex: 0 0 60px;
    height: 2px;
    background: var(--border);
    margin-top: -22px;
}

/* ---------------- Form steps ---------------- */

.form-step {
    display: none;
}

.form-step[data-active] {
    display: block;
}

.form-section-title {
    color: var(--text-heading);
    font-size: 18px;
    margin: 24px 0 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-section-hint {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 0 16px;
}

.form-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 8px;
}

.form-grid-1 { grid-template-columns: 1fr; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}

/* ---------------- Fields ---------------- */

.field {
    display: flex;
    flex-direction: column;
}

.field-label {
    color: var(--text-heading);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.req {
    color: var(--danger);
}

.field-input {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-heading);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    min-height: 44px;
}

.field-input:focus {
    outline: none;
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(134, 164, 159, 0.2);
}

.field-input:disabled, .field-input[readonly] {
    background: var(--bg-light);
    cursor: not-allowed;
    color: var(--text-secondary);
}

.field-input.is-invalid {
    border-color: var(--danger);
}

.field-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    min-height: 14px;
}

.field-hint {
    color: var(--text-secondary);
    font-size: 12px;
    margin: 6px 0 0;
}

.field-phone-wrapper {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    overflow: hidden;
}

.field-phone-wrapper:focus-within {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(134, 164, 159, 0.2);
}

.field-phone-prefix {
    padding: 10px 14px;
    background: var(--bg-light);
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    border-inline-end: 1px solid var(--border);
}

.field-phone-input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.field-phone-input:focus {
    box-shadow: none;
    border: none;
}

/* ---------------- Checkboxes & Yes/No ---------------- */

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.checkbox-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.checkbox-pill:has(input:checked) {
    border-color: var(--brand-primary);
    background: rgba(53, 104, 95, 0.05);
}

.checkbox-pill input[type="checkbox"] {
    accent-color: var(--brand-primary);
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-heading);
}

.checkbox-row input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--brand-primary);
    flex-shrink: 0;
}

.question-row {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-light);
}

.question-label {
    color: var(--text-heading);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
}

.yesno-group {
    display: inline-flex;
    gap: 8px;
}

.yesno-btn {
    padding: 8px 24px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-heading);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.yesno-btn.is-active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.yesno-btn:hover:not(.is-active) {
    border-color: var(--brand-teal);
}

/* ---------------- File upload ---------------- */

.upload-card {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-light);
    padding: 24px 16px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-card:hover, .upload-card.is-dragover {
    border-color: var(--brand-teal);
    background: rgba(134, 164, 159, 0.05);
}

.upload-card.has-file {
    border-style: solid;
    border-color: var(--brand-green-light);
    background: var(--bg-white);
}

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.upload-icon {
    font-size: 28px;
    color: var(--brand-primary);
}

.upload-cta {
    font-size: 13px;
}

.upload-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.upload-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--border);
}

.upload-thumb[data-pdf="1"] {
    background: var(--brand-beige);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-filename {
    flex: 1;
    text-align: start;
    font-size: 13px;
    color: var(--text-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.upload-remove {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    position: relative;
    z-index: 2;
}

.upload-remove:hover {
    background: var(--danger);
    color: #fff;
}

/* ---------------- Buttons / Navigation ---------------- */

.form-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn {
    padding: 12px 32px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, background 0.15s;
    min-width: 120px;
}

.btn-primary {
    background: var(--brand-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-light);
    color: #000;
    border: 1px solid var(--brand-primary);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-heading);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

/* ---------------- Error banner ---------------- */

.form-error-banner {
    background: #FDECEA;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
}

/* ---------------- Status pages ---------------- */

.status-page {
    max-width: 600px;
    margin: 64px auto;
    padding: 0 16px;
    text-align: center;
}

.status-page-inner {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.status-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.status-icon-success {
    color: var(--success);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(46, 125, 50, 0.1);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.status-title {
    font-size: 26px;
    color: var(--text-heading);
    margin: 0 0 16px;
}

.status-message {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 32px;
}

.terms-content {
    background: #fafafa;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 20px 22px;
    margin: 0 0 18px;
    max-height: 360px;
    overflow-y: auto;
    line-height: 1.9;
    color: var(--text-body, #333);
    font-size: 15px;
}

.terms-content p {
    margin: 0 0 12px;
}

.terms-content p:last-child {
    margin-bottom: 0;
}

