/**
 * UpLife — global form bileşenleri (tüm sayfalarda tutarlı alanlar)
 * Token’lar: style.css :root. Çerçeve yok; gölge + radius 8px (DESIGN.md).
 */

.uplife-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.uplife-form__head {
    display: block;
}

.uplife-form__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--section-dark-bg);
}

.uplife-form__lede {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--secondary-color-dark);
    max-width: 36rem;
}

.uplife-form__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.1rem;
}

.uplife-form__field {
    min-width: 0;
}

.uplife-form__field--full {
    grid-column: 1 / -1;
}

.uplife-form__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}

.uplife-form__shell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.85rem;
    padding: 0 0.85rem;
    border-radius: 8px;
    background: var(--tertiary-color);
    box-shadow: 0 4px 18px rgba(31, 58, 95, 0.06);
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.uplife-form__shell:focus-within {
    box-shadow: 0 6px 28px rgba(104, 63, 145, 0.16);
    background: rgba(243, 244, 248, 0.95);
}

.uplife-form__shell > i:first-of-type {
    flex-shrink: 0;
    color: var(--color-primary);
    font-size: 0.85rem;
    opacity: 0.9;
}

.uplife-form__shell input:not([type="checkbox"]):not([type="radio"]),
.uplife-form__shell textarea {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    color: var(--text-dark);
    padding: 0.55rem 0;
    outline: none;
}

.uplife-form__shell textarea {
    min-height: 6.5rem;
    padding: 0.65rem 0;
    resize: vertical;
}

.uplife-form__shell--textarea {
    align-items: flex-start;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.uplife-form__shell--textarea > i:first-of-type {
    margin-top: 0.35rem;
}

/* ---------- Özel select (native gizli; tetikleyici + panel) ---------- */
.uplife-form__shell--select {
    position: relative;
    align-items: center;
    z-index: 1;
}

.uplife-form__shell--select.is-open {
    z-index: 40;
}

/* JS yokken veya init öncesi: native select aynı kabukta */
.uplife-form__shell--select:not([data-uplife-select-initialized="1"]) select {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    color: var(--text-dark);
    padding: 0.55rem 0;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23683f91' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 1.25rem;
}

.uplife-form__select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.uplife-form__select-trigger {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
    margin: 0;
    padding: 0.55rem 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    color: var(--text-dark);
    cursor: pointer;
    text-align: left;
    outline: none;
    border-radius: 4px;
}

.uplife-form__select-trigger:focus-visible {
    box-shadow: 0 0 0 2px rgba(104, 63, 145, 0.35);
}

.uplife-form__select-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uplife-form__select-value.is-placeholder {
    color: var(--secondary-color-dark);
    font-weight: 500;
}

.uplife-form__select-caret {
    flex-shrink: 0;
    display: inline-flex;
    color: var(--color-primary);
    font-size: 0.7rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.uplife-form__shell--select.is-open .uplife-form__select-caret {
    transform: rotate(180deg);
}

.uplife-form__select-caret i {
    font-size: inherit;
}

.uplife-form__select-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: 0 12px 40px rgba(31, 58, 95, 0.18);
    max-height: min(280px, 42vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.uplife-form__select-panel[hidden] {
    display: none !important;
}

.uplife-form__select-option {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.9rem;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-dark);
    text-align: left;
    cursor: pointer;
    outline: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.uplife-form__select-option:hover,
.uplife-form__select-option.is-active {
    background: var(--tertiary-color);
}

.uplife-form__select-option:focus-visible {
    background: rgba(104, 63, 145, 0.12);
}

.uplife-form__select-option[aria-selected="true"] {
    background: rgba(104, 63, 145, 0.12);
    color: var(--color-primary-dark);
    font-weight: 700;
}

.uplife-form__select-option.is-placeholder {
    color: var(--secondary-color-dark);
    font-weight: 500;
}

.uplife-form__captcha-slot {
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--secondary-color-dark);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    background: var(--tertiary-color);
    box-shadow: 0 4px 14px rgba(31, 58, 95, 0.05);
}

.uplife-form__privacy {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.55;
    color: var(--secondary-color-dark);
}

.uplife-form__privacy a {
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.uplife-form__privacy a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.uplife-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    margin-top: 0.15rem;
    padding: 0.95rem 1.25rem;
    border: none;
    border-radius: 8px;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-light);
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 12px 36px rgba(104, 63, 145, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.uplife-form__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 44px rgba(104, 63, 145, 0.4);
}

.uplife-form__submit:active {
    transform: translateY(0);
}

.uplife-form__submit i {
    font-size: 0.85rem;
}

@media (max-width: 767px) {
    .uplife-form__fields {
        grid-template-columns: 1fr;
    }
}
