:root {
    --green: #0b7a5b;
    --green-dark: #075e46;
    --bg: #f7faf9;
    --card: #ffffff;
    --border: #d9e7e2;
    --text: #1f2937;
    --muted: #475467;
    --accent: #e8f5f0;
    --danger-soft: #fef3f2;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(7, 94, 70, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    direction: rtl;
    font-family: Tajawal, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.container {
    width: min(1080px, calc(100% - 2rem));
    margin-inline: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 12px;
    min-height: 44px;
    padding: 0.55rem 1rem;
    font-weight: 700;
    transition: 0.2s ease;
    text-decoration: none;
}
.btn-sm {
    min-height: 38px;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--green);
    color: #fff;
}

.btn-primary:hover {
    background: var(--green-dark);
}

.btn-ghost {
    background: #fff;
    border-color: var(--border);
    color: var(--green-dark);
}

.btn-ghost:hover {
    background: var(--accent);
}

.form-topbar {
    border-bottom: 1px solid #e7efec;
    background: #f8fcfa;
}

.form-topbar-inner {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    color: var(--green-dark);
    font-weight: 800;
    font-size: 1.05rem;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.form-main {
    padding: 1.4rem 0 2.5rem;
}

.form-card-wrap {
    width: min(960px, 100%);
    margin-inline: auto;
}

.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.1rem;
}

@media (min-width: 760px) {
    .form-card {
        padding: 1.35rem 1.4rem;
    }
}

.form-head {
    margin-bottom: 1rem;
}

.form-head h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    color: var(--green-dark);
}

.form-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.form-message {
    display: none;
    margin-bottom: 0.9rem;
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    border: 1px solid transparent;
    font-weight: 600;
}

.form-message.show {
    display: block;
}

.form-message.success {
    background: var(--accent);
    border-color: #c8e5db;
    color: var(--green-dark);
}

.form-message.warning {
    background: var(--danger-soft);
    border-color: #fecdca;
    color: #b42318;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem 1rem;
}

@media (min-width: 780px) {
    .field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.field-full {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 700;
    color: #22313f;
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    min-height: 46px;
    padding: 0.55rem 0.75rem;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.65;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #7a8696;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(11, 122, 91, 0.12);
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.contacts-section {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e9efec;
}

.contacts-section h2 {
    margin: 0 0 0.65rem;
    font-size: 1.05rem;
    color: var(--green-dark);
}

.contacts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    margin-bottom: 0.65rem;
}

.contact-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfefd;
    padding: 0.75rem;
    margin-bottom: 0.65rem;
}

.btn-remove-contact {
    margin-top: 0.55rem;
    background: #fff;
    color: #b42318;
    border-color: #fecdca;
}

.btn-remove-contact:hover {
    background: #fef3f2;
}

@media (max-width: 640px) {
    .form-actions .btn,
    .top-actions .btn {
        width: 100%;
    }
}
