/**
 * ATIKASS Form — Components: Steps, Insurance grid, Profile cards,
 *                            Inputs, Buttons, Checkbox, Phone, Alerts
 */

/* ── Alert ────────────────────────────────── */
.atkf-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--atkf-radius-sm);
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}
.atkf-alert--error {
    background: var(--atkf-error-bg);
    color: var(--atkf-error);
    border: 1px solid #fecaca;
}

/* ── Steps / Fieldsets ────────────────────── */
.atkf-wrapper form    { position: relative; }
.atkf-wrapper fieldset { border: none; padding: 0; }

.atkf-step {
    display: none;
    animation: atkfFadeSlideIn 0.35s var(--atkf-ease);
}
.atkf-step.active { display: block; }

@keyframes atkfFadeSlideIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.atkf-step__title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--atkf-text);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}
.atkf-step__subtitle {
    font-size: 0.88rem;
    color: var(--atkf-text-secondary);
    margin-bottom: 28px;
}
.atkf-step__error {
    color: var(--atkf-error);
    font-size: 0.82rem;
    font-weight: 500;
    min-height: 1.2em;
    margin-top: 8px;
}
.atkf-step__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    gap: 12px;
}

/* ── Insurance Grid ───────────────────────── */
.atkf-insurance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.atkf-insurance-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--atkf-white);
    border: 2px solid var(--atkf-border);
    border-radius: var(--atkf-radius-md);
    cursor: pointer;
    transition: var(--atkf-transition);
    user-select: none;
}
.atkf-insurance-card:hover {
    border-color: var(--atkf-primary-light);
    background: var(--atkf-primary-bg);
}
.atkf-insurance-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.atkf-insurance-card--selected,
.atkf-insurance-card:has(input:checked) {
    border-color: var(--atkf-primary);
    background: var(--atkf-primary-bg);
    box-shadow: var(--atkf-shadow-focus);
}
.atkf-insurance-card__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--atkf-primary-light);
    border-radius: 8px;
    color: var(--atkf-primary);
}
.atkf-insurance-card__icon img {
    max-width: 20px;
    max-height: 20px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.atkf-insurance-card__name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--atkf-text);
    flex: 1;
}
.atkf-insurance-card__check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--atkf-border);
    color: transparent;
    transition: var(--atkf-transition);
}
.atkf-insurance-card:has(input:checked) .atkf-insurance-card__check {
    background: var(--atkf-primary);
    color: var(--atkf-white);
}

/* ── Profile Choice ───────────────────────── */
.atkf-profile-choice {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.atkf-profile-card {
    cursor: pointer;
    position: relative;
}
.atkf-profile-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.atkf-profile-card__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 20px;
    background: var(--atkf-white);
    border: 2px solid var(--atkf-border);
    border-radius: var(--atkf-radius-lg);
    transition: var(--atkf-transition);
}
.atkf-profile-card:hover .atkf-profile-card__inner {
    border-color: var(--atkf-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--atkf-shadow-md);
}
.atkf-profile-card:has(input:checked) .atkf-profile-card__inner {
    border-color: var(--atkf-primary);
    background: var(--atkf-primary-bg);
    box-shadow: var(--atkf-shadow-focus);
    transform: translateY(-2px);
}
.atkf-profile-card__icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--atkf-primary-light);
    border-radius: 50%;
    color: var(--atkf-primary);
    transition: var(--atkf-transition);
}
.atkf-profile-card:has(input:checked) .atkf-profile-card__icon {
    background: var(--atkf-gradient);
    color: var(--atkf-white);
}
.atkf-profile-card__text { display: flex; flex-direction: column; gap: 2px; }
.atkf-profile-card__title { font-size: 1rem; font-weight: 700; color: var(--atkf-text); }
.atkf-profile-card__desc { font-size: 0.78rem; color: var(--atkf-text-secondary); }

/* ── Form Inputs ──────────────────────────── */
.atkf-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.atkf-form-group { margin-bottom: 18px; }
.atkf-form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--atkf-text);
    margin-bottom: 6px;
}
.atkf-required { color: var(--atkf-error); }
.atkf-optional { font-weight: 400; color: var(--atkf-text-muted); font-size: 0.75rem; }

.atkf-form-input {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--atkf-text);
    background: var(--atkf-white);
    border: 2px solid var(--atkf-border);
    border-radius: var(--atkf-radius-sm);
    outline: none;
    transition: var(--atkf-transition);
}
.atkf-form-input::placeholder { color: var(--atkf-text-muted); }
.atkf-form-input:hover { border-color: #c7c0e4; }
.atkf-form-input:focus {
    border-color: var(--atkf-primary);
    box-shadow: var(--atkf-shadow-focus);
}
.atkf-form-input.is-error {
    border-color: var(--atkf-error);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.atkf-form-input.is-valid { border-color: var(--atkf-success); }
.atkf-form-error {
    display: block;
    font-size: 0.76rem;
    color: var(--atkf-error);
    margin-top: 4px;
    min-height: 1em;
}

/* ── Phone Input ──────────────────────────── */
.atkf-phone-input-wrapper {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--atkf-border);
    border-radius: var(--atkf-radius-sm);
    overflow: hidden;
    transition: var(--atkf-transition);
    background: var(--atkf-white);
}
.atkf-phone-input-wrapper:hover { border-color: #c7c0e4; }
.atkf-phone-input-wrapper:focus-within {
    border-color: var(--atkf-primary);
    box-shadow: var(--atkf-shadow-focus);
}
.atkf-phone-input-wrapper.is-error {
    border-color: var(--atkf-error);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.atkf-phone-prefix {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    background: #f8f6ff;
    border-right: 2px solid var(--atkf-border);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--atkf-text-secondary);
    white-space: nowrap;
}
.atkf-form-input--phone {
    border: none;
    border-radius: 0;
    box-shadow: none !important;
}

/* ── Checkbox ─────────────────────────────── */
.atkf-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 12px 0;
    user-select: none;
}
.atkf-checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.atkf-checkbox-custom {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--atkf-border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--atkf-transition);
    margin-top: 1px;
    background: var(--atkf-white);
}
.atkf-checkbox-custom::after {
    content: '';
    width: 10px;
    height: 6px;
    border: 2px solid var(--atkf-white);
    border-top: none;
    border-right: none;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.15s ease;
}
.atkf-checkbox-wrapper input:checked + .atkf-checkbox-custom {
    background: var(--atkf-primary);
    border-color: var(--atkf-primary);
}
.atkf-checkbox-wrapper input:checked + .atkf-checkbox-custom::after {
    transform: rotate(-45deg) scale(1);
}
.atkf-checkbox-label { font-size: 0.85rem; color: var(--atkf-text-secondary); line-height: 1.5; }

/* ── Pro Fields ───────────────────────────── */
.atkf-pro-fields { margin-top: 4px; animation: atkfFadeSlideIn 0.3s ease; }
.atkf-pro-fields[hidden] { display: none; }

/* ── Buttons ──────────────────────────────── */
.atkf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    border: none;
    border-radius: var(--atkf-radius-sm);
    cursor: pointer;
    transition: var(--atkf-transition);
    text-decoration: none !important;
    line-height: 1;
    white-space: nowrap;
}
.atkf-btn:focus-visible { outline: 2px solid var(--atkf-primary); outline-offset: 2px; }

.atkf-btn--primary {
    background: var(--atkf-gradient) !important;
    color: var(--atkf-white) !important;
    box-shadow: 0 2px 10px rgba(108,60,224,0.3);
}
.atkf-btn--primary:hover,
.atkf-btn--primary:focus,
.atkf-btn--primary:active,
.atkf-btn--primary:visited {
    color: var(--atkf-white) !important;
    background: var(--atkf-gradient) !important;
}
.atkf-btn--primary:hover {
    box-shadow: 0 6px 20px rgba(108,60,224,0.4);
    transform: translateY(-1px);
}
.atkf-btn--primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(108,60,224,0.3);
}
.atkf-btn--primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.atkf-btn--ghost {
    background: transparent !important;
    color: var(--atkf-text-secondary) !important;
    padding: 12px 18px;
}
.atkf-btn--ghost:hover,
.atkf-btn--ghost:focus {
    background: var(--atkf-primary-bg) !important;
    color: var(--atkf-primary) !important;
}
.atkf-btn--ghost:visited {
    color: var(--atkf-text-secondary) !important;
}

.atkf-btn--submit { min-width: 190px; }

.atkf-btn__text[hidden],
.atkf-btn__loader[hidden] { display: none !important; }
.atkf-btn__loader { display: inline-flex; align-items: center; gap: 8px; }

.atkf-spinner { animation: atkfSpin 0.8s linear infinite; }
@keyframes atkfSpin { to { transform: rotate(360deg); } }
