/* =========================================================================
 * Attorna — Free Consultation Section (RTL)
 * Design tokens mirror assets/css/section-testimonials.css so the section
 * sits flush against Testimonials with the same background + gold accent.
 * ========================================================================= */

.cs-section {
    --cs-ink:        #1c1c1c;
    --cs-ink-soft:   #5c564c;
    --cs-desc:       #666666;
    --cs-gold:       #a38753;
    --cs-gold-dark:  #8a7143;
    --cs-gold-light: #b49a63;
    --cs-bg:         #fbf8f2;
    --cs-line:       rgba(30, 28, 24, 0.15);
    --cs-error:      #c0392b;
    --cs-success:    #1e7d43;
    --cs-error-bg:   #fdecea;
    --cs-success-bg: #e8f5ee;
    --cs-shadow-soft:  0 18px 40px -26px rgba(23, 20, 14, 0.28);
    --cs-ease:       cubic-bezier(0.22, 0.61, 0.36, 1);

    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg,
            rgba(251, 248, 242, 0.99) 0%,
            rgba(251, 248, 242, 0.92) 100%
        );
    color: var(--cs-ink);
    direction: rtl;
    text-align: right;
    padding: 88px 0 96px;
    font-family: var(--font-family-base, 'IRANSans', Tahoma, sans-serif);
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
}

/* Soft gold glow behind the header (matches .ts-section) */
.cs-section::before {
    content: "";
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 720px;
    height: 480px;
    background: radial-gradient(closest-side, rgba(163, 135, 83, 0.08), transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* ---------- Container + Grid ---------- */
.cs-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
}

.cs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: start;
}

@media (min-width: 921px) {
    .cs-grid {
        grid-template-columns: 1fr 1.1fr;
        gap: 56px;
    }
}

/* ---------- Info column ---------- */
.cs-info {
    display: block;
}

.cs-accent {
    display: block;
    width: 64px;
    height: 3px;
    margin: 0 0 18px;
    margin-inline-start: 0; /* keep right-aligned in RTL */
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--cs-gold) 20%, var(--cs-gold) 80%, transparent);
}

.cs-heading {
    margin: 0 0 14px;
    font-family: var(--font-family-heading, 'Jost', 'IRANSans', Tahoma, sans-serif);
    font-size: clamp(28px, 3.6vw, 44px);
    line-height: 1.4;
    font-weight: var(--font-weight-bold, 700);
    color: var(--cs-ink);
    letter-spacing: -0.01em;
}

.cs-desc {
    margin: 0 0 32px;
    color: var(--cs-desc);
    font-size: 16px;
    line-height: 2.05;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

/* Contact list */
.cs-contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 18px;
}

.cs-contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    color: var(--cs-ink-soft);
}

.cs-contact-item > a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s var(--cs-ease);
}
.cs-contact-item > a:hover { color: var(--cs-gold-dark); }
.cs-contact-item > a:hover { text-decoration: none; }

.cs-contact-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--cs-gold-dark);
    background: rgba(163, 135, 83, 0.10);
    border: 1px solid rgba(163, 135, 83, 0.22);
    font-size: 16px;
}

.cs-contact-text,
.cs-contact-item a {
    word-break: break-word;
}

.cs-ltr {
    direction: ltr;
    unicode-bidi: embed;
    text-align: left;
    display: inline-block;
}

/* ---------- Form ---------- */
.cs-form-col {
    min-width: 0;
}

.cs-form {
    margin: 0;
    padding: 34px 30px 30px;
    background: #ffffff;
    border: 1px solid var(--cs-line);
    border-radius: 12px;
    box-shadow: var(--cs-shadow-soft);
    display: grid;
    gap: 18px;
}

.cs-row {
    display: grid;
    gap: 14px;
}
.cs-row--half {
    grid-template-columns: 1fr;
}
@media (min-width: 600px) {
    .cs-row--half {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

.cs-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.cs-field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--cs-ink-soft);
    line-height: 1.6;
}

.cs-req {
    color: var(--cs-error);
    font-weight: 700;
}

.cs-field input,
.cs-field select,
.cs-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--cs-ink);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.7;
    transition: border-color 0.18s var(--cs-ease),
                box-shadow 0.18s var(--cs-ease),
                background 0.18s var(--cs-ease);
 appearance: none;
    -webkit-appearance: none;
}

.cs-field select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235c564c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 12px 8px;
    padding-left: 38px;
    cursor: pointer;
}

.cs-field textarea {
    resize: vertical;
    min-height: 130px;
}

.cs-field input::placeholder,
.cs-field textarea::placeholder,
.cs-field select:invalid {
    color: rgba(30, 28, 24, 0.42);
}

.cs-field input:focus,
.cs-field select:focus,
.cs-field textarea:focus {
    outline: none;
    border-color: var(--cs-gold);
    box-shadow: 0 0 0 3px rgba(163, 135, 83, 0.18);
    background: #fffdf9;
}

/* :focus-visible is the more semantic rule for keyboard focus */
.cs-field input:focus-visible,
.cs-field select:focus-visible,
.cs-field textarea:focus-visible {
    outline: none;
    border-color: var(--cs-gold);
    box-shadow: 0 0 0 3px rgba(163, 135, 83, 0.22);
}

/* Error states */
.cs-field.has-error input,
.cs-field.has-error select,
.cs-field.has-error textarea {
    border-color: var(--cs-error);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

.cs-error {
    display: none;
    min-height: 1em;
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--cs-error);
    line-height: 1.6;
}
.cs-error:not(:empty) {
    display: block;
}
.cs-field.has-error .cs-error {
    display: block;
}

/* ---------- Submit button ---------- */
.cs-button-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.cs-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 34px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--cs-gold-light) 0%, var(--cs-gold-dark) 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.4;
    cursor: pointer;
    transition: transform 0.15s var(--cs-ease),
                box-shadow 0.2s var(--cs-ease),
                filter 0.2s var(--cs-ease);
    box-shadow: 0 12px 24px -14px rgba(138, 113, 67, 0.6);
    min-width: 200px;
}
.cs-submit:hover {
    filter: brightness(1.05);
    box-shadow: 0 16px 30px -14px rgba(138, 113, 67, 0.7);
    transform: translateY(-1px);
}
.cs-submit:active {
    transform: translateY(0);
    filter: brightness(0.96);
    box-shadow: 0 8px 18px -12px rgba(138, 113, 67, 0.6);
    background: linear-gradient(180deg, var(--cs-gold) 0%, #7a6238 100%);
}
.cs-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(163, 135, 83, 0.45);
}
.cs-submit:disabled,
.cs-submit.is-loading {
    cursor: not-allowed;
}
.cs-submit.is-loading .cs-label {
    opacity: 0.85;
}

/* Button spinner */
.cs-btn__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cs-spin 0.7s linear infinite;
    flex: 0 0 auto;
}
.cs-submit.is-loading .cs-btn__spinner {
    display: inline-block;
}

@keyframes cs-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---------- Form-level alert banner ---------- */
.cs-form-alert {
    display: none;
    margin: 4px 0 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.7;
    border: 1px solid transparent;
}
.cs-form-alert:not([hidden]) {
    display: block;
}
.cs-form-alert.is-error {
    color: var(--cs-error);
    background: var(--cs-error-bg);
    border-color: rgba(192, 57, 43, 0.25);
}
.cs-form-alert.is-success {
    color: var(--cs-success);
    background: var(--cs-success-bg);
    border-color: rgba(30, 125, 67, 0.25);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cs-submit,
    .cs-btn__spinner,
    .cs-field input,
    .cs-field select,
    .cs-field textarea {
        transition: none !important;
    }
}
