/**
 * ca-form-base.css — Общие стили для всех форм темы.
 *
 * Подключается как зависимость перед конкретным CSS формы.
 * Все формы должны иметь class="ca-form".
 * CSS-переменные --color-primary / --color-primary-rgb / --color-primary-25
 * задаются глобально на :root через color-schemes.php.
 *
 * Используется в: ca_form_registration, ca_form_partner_anketa, ca_form_speaker_anketa.
 *
 * @version 2.7.0
 * @date    2026-02-18
 */

/* ================================================================
 * 1. КОНТЕЙНЕР И ГРУППЫ
 * ================================================================ */
.ca-form { max-width: 1200px; margin: 0 auto; box-sizing: border-box; }
.ca-form .form-group { margin-bottom: 20px; }

/* ================================================================
 * 2. ЛЕЙБЛЫ
 * ================================================================ */
.ca-form label { display: block; font-size: 14px; font-weight: 500; color: #555; margin-bottom: 8px; }
.ca-form label .required { color: #dc3545; margin-left: 3px; }
.ca-form label small { font-weight: 400; color: #666; font-size: 12px; }
.ca-form label > span { vertical-align: middle; }

/* ================================================================
 * 3. ПОЛЯ ВВОДА (input, select, textarea)
 * ================================================================ */
.ca-form input[type="text"],
.ca-form input[type="email"],
.ca-form input[type="tel"],
.ca-form input[type="date"],
.ca-form input[type="number"],
.ca-form textarea,
.ca-form select { width: 100%; padding: 12px 16px; font-size: 15px; border: 2px solid #e0e0e0; border-radius: 8px; background: #fff; transition: all .3s ease; box-sizing: border-box; font-family: inherit; }
.ca-form input:focus,
.ca-form textarea:focus,
.ca-form select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), .1); }
.ca-form textarea { min-height: 100px; resize: vertical; }

/* === Кастомная стрелка select === */
.ca-form select { 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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* === Заблокированные поля === */
.ca-form input.locked-field { background: #f6f6f6; color: #777; }

/* ================================================================
 * 4. FLOATING-LABEL ПОЛЯ (.fl-field)
 * ================================================================ */
.fl-field { position: relative; margin-bottom: 0; }
.fl-field input,
.fl-field textarea { width: 100%; border: 0 !important; border-bottom: 2px solid #ccc !important; border-radius: 0 !important; padding: 22px 32px 8px 2px !important; font-size: 15px !important; font-weight: 500 !important; font-family: inherit !important; background: transparent !important; box-shadow: none !important; outline: none !important; transition: border-color .25s; box-sizing: border-box; color: #1a1a1a !important; }
.fl-field textarea { border: 1px solid #ccc !important; border-radius: 8px !important; padding: 28px 14px 10px 14px !important; resize: vertical; min-height: 56px; }
/* Label */
.fl-label { position: absolute; left: 2px; top: 16px; font-size: 15px; font-weight: 400; color: #999; pointer-events: none; transition: all .2s cubic-bezier(.4,0,.2,1); transform-origin: left top; white-space: nowrap; }
.fl-textarea .fl-label { left: 14px; top: 12px; }
/* Floated state */
.fl-field input:focus + .fl-label,
.fl-field input:not(:placeholder-shown) + .fl-label,
.fl-field textarea:focus + .fl-label,
.fl-field textarea:not(:placeholder-shown) + .fl-label { top: 2px; font-size: 11px; color: var(--color-primary); font-weight: 600; letter-spacing: 0.02em; }
.fl-field input:not(:focus):not(:placeholder-shown) + .fl-label,
.fl-field textarea:not(:focus):not(:placeholder-shown) + .fl-label { color: #888; }
/* Focus line */
.fl-field input:focus,
.fl-field textarea:focus { border-bottom-color: var(--color-primary) !important; }
.fl-field textarea:focus { border-color: var(--color-primary) !important; }

/* === Validation icon === */
.fl-icon { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; font-size: 16px; line-height: 20px; text-align: center; opacity: 0; transition: opacity .25s; pointer-events: none; }
/* Valid */
.fl-field.fl-valid input { border-bottom-color: var(--color-primary) !important; }
.fl-field.fl-valid .fl-icon { opacity: 1; color: var(--color-primary); }
.fl-field.fl-valid .fl-icon::after { content: '\2713'; }
/* Invalid */
.fl-field.fl-invalid input { border-bottom-color: #e74c3c !important; }
.fl-field.fl-invalid .fl-icon { opacity: 1; color: #e74c3c; }
.fl-field.fl-invalid .fl-icon::after { content: '!'; font-weight: 700; }
/* Warning */
.fl-field.fl-warning input { border-bottom-color: #f39c12 !important; }
.fl-field.fl-warning .fl-icon { opacity: 1; color: #f39c12; }
.fl-field.fl-warning .fl-icon::after { content: '\26A0'; font-size: 14px; }
/* Field invalid glow */
.field-invalid { border-color: #e53935 !important; box-shadow: 0 0 0 2px rgba(229,57,53,.15) !important; }
.field-invalid:focus { border-color: #e53935 !important; box-shadow: 0 0 0 2px rgba(229,57,53,.25) !important; }

/* ================================================================
 * 5. КАРТОЧКИ ВЫБОРА (.fieldset-inline)
 * ================================================================ */
.fieldset-inline { border: 0; padding: 0; margin-bottom: 1.2rem; display: flex; gap: 1rem; }
.fieldset-inline input { opacity: 0; width: 0; height: 0; position: absolute; }
.fieldset-inline label { flex: 1; text-align: left; background: #fff; border: 2px solid #e8e8e8; border-radius: 16px; padding: 28px 30px; transition: all .2s ease; font-weight: 400; cursor: pointer; position: relative; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.fieldset-inline label:hover { border-color: #ccc; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.fieldset-inline label.checked { border-color: var(--color-primary); background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.label-title { text-align: left; font-weight: 700; font-size: 20px !important; margin-bottom: 12px; color: #222; opacity: .5; transition: opacity .2s; }
.label-text { text-align: left; font-size: 14px !important; font-weight: 400; line-height: 22px; color: #555; opacity: .5; transition: opacity .2s; }
.fieldset-inline label.checked .label-title,
.fieldset-inline label.checked .label-text { opacity: 1; }

/* ================================================================
 * 6. КАРТОЧКИ С SVG-ИКОНКАМИ (.pt-card)
 * ================================================================ */
.pt-card { position: relative; overflow: hidden; }
.pt-icon { position: absolute; right: -30px; bottom: -30px; width: 170px; height: 170px; color: #aaa; opacity: .18; transition: transform .45s cubic-bezier(.4,0,.2,1), opacity .45s; pointer-events: none; z-index: 0; }
.pt-card .label-title,
.pt-card .label-text { position: relative; z-index: 1; }
.pt-card:hover .pt-icon { transform: scale(1.14) rotate(-3deg); opacity: .28; }
.pt-card.checked .pt-icon { transform: scale(1.3) rotate(-5deg); opacity: .36; color: var(--color-primary); }

/* ================================================================
 * 7. КАРТОЧКИ СОГЛАШЕНИЙ (.agree-card)
 * ================================================================ */
.agree-card { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f3f4f5; border: 2px solid #e0e0e0; border-radius: 10px; padding: 14px 18px; transition: all .2s; opacity: .6; }
.agree-card:hover { opacity: .8; }
.agree-card.agreed { border-color: var(--color-primary); background: #fff; opacity: 1; }
.agree-card-title { font-weight: 500; font-size: 15px; color: #000; line-height: 1.4; }
.agree-btn { flex-shrink: 0; background: #e8e9eb; border: none; border-radius: 8px; padding: 8px 18px; font-size: 13px; font-weight: 600; font-family: inherit; color: #333; cursor: pointer; transition: all .2s; white-space: nowrap; }
.agree-btn:hover { background: #dcdde0; }
.agree-btn.agreed { background: var(--color-primary); color: #fff; cursor: default; pointer-events: none; }

/* ================================================================
 * 8. МОДАЛКА СОГЛАШЕНИЙ
 * ================================================================ */
.agreement-modal { display: none; position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.5); align-items: center; justify-content: center; padding: 20px; }
.agreement-modal.active { display: flex; }
.agreement-modal-content { background: #fff; border-radius: 16px; max-width: 860px; width: 100%; max-height: 65vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: agreementSlideUp .25s ease-out; }
@keyframes agreementSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.agreement-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; border-bottom: 1px solid #eee; }
.agreement-modal-header h3 { margin: 0; font-size: 20px; font-weight: 700; }
.agreement-modal-close { background: none; border: none; font-size: 28px; cursor: pointer; color: #999; padding: 0 4px; line-height: 1; transition: color .15s; }
.agreement-modal-close:hover { color: #333; }
.agreement-modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; font-size: 14px; line-height: 1.7; color: #333; }
.agreement-modal-body h2 { font-size: 18px; margin: 0 0 12px; }
.agreement-modal-body h3 { font-size: 15px; margin: 18px 0 8px; }
.agreement-modal-body p  { margin: 0 0 10px; }
.agreement-modal-body ul { margin: 0 0 10px; padding-left: 20px; }
.agreement-modal-body li { margin-bottom: 4px; }
.agreement-modal-footer { padding: 12px 24px 20px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; }
.agreement-modal-confirm { background: var(--color-primary); color: #fff; border: none; border-radius: 8px; padding: 12px 32px; font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.agreement-modal-confirm:hover { opacity: .85; }

/* ================================================================
 * 9. ТУМБЛЕР (.toggle-label / .toggle-switch)
 * ================================================================ */
.toggle-label { display: flex !important; align-items: center; cursor: pointer; gap: 12px; padding: 15px 0 !important; margin: 10px 0 !important; border: none !important; background: transparent !important; }
.toggle-label input[type="checkbox"] { display: none; }
.toggle-switch { position: relative; width: 50px; height: 26px; background: #ccc; border-radius: 13px; transition: background 0.3s; flex-shrink: 0; }
.toggle-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: white; border-radius: 50%; transition: transform 0.3s; }
.toggle-label input[type="checkbox"]:checked + .toggle-switch { background: var(--color-primary); }
.toggle-label input[type="checkbox"]:checked + .toggle-switch::after { transform: translateX(24px); }
.toggle-text { font-size: 16px; font-weight: 500; color: #000; }

/* ================================================================
 * 10. КНОПКА ОТПРАВКИ (.submit-btn)
 * ================================================================ */
.ca-form .submit-btn { width: 100%; padding: 16px 32px; font-size: 16px; font-weight: 600; color: #fff; background: var(--color-primary); border: none; border-radius: 8px; cursor: pointer; transition: all .3s ease; margin-top: 20px; }
.ca-form .submit-btn:hover:not(:disabled) { opacity: .9; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.ca-form .submit-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* ================================================================
 * 11. СООБЩЕНИЯ ФОРМЫ (.form-message)
 * ================================================================ */
.ca-form .form-message { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; display: none; font-weight: 500; }
.ca-form .form-message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; display: block; }
.ca-form .form-message.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; display: block; }
.ca-form .form-message.info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; display: block; }
.ca-form .form-message.warning { background: #fff3e0; color: #e65100; border: 1px solid #ffb74d; display: block; }
.ca-form .form-message.checking { background: #e3f2fd; color: #1976d2; border: 1px solid #90caf9; display: block; }

/* ================================================================
 * 12. ДВУХКОЛОНОЧНАЯ РАСКЛАДКА (.form-row)
 * ================================================================ */
.ca-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ================================================================
 * 13. АДАПТИВНЫЕ СТИЛИ
 * ================================================================ */
@media (max-width: 768px) {
.ca-form .form-row { grid-template-columns: 1fr; }
.agreement-modal-content { max-height: 90vh; border-radius: 12px; }
.agreement-modal-body { padding: 16px; }
.fl-field input,
.fl-field textarea { font-size: 14px !important; padding: 20px 28px 6px 2px !important; }
.fl-label { font-size: 14px; top: 14px; }
.fl-field input:focus + .fl-label,
.fl-field input:not(:placeholder-shown) + .fl-label,
.fl-field textarea:focus + .fl-label,
.fl-field textarea:not(:placeholder-shown) + .fl-label { font-size: 10px; top: 1px; }
}
