/* ===================================================================
   CI Form – Formular-Styles
   Nutzt ausschliesslich --ci-* CSS Custom Properties aus dem Theme.
   Funktioniert in .ci-form-card (aus landing-base.css) und standalone.
   =================================================================== */

/* --- Feld-Container --- */
.ci-form-field {
    margin-bottom: 1rem;
}

/* --- Zwei-Spalten-Row --- */
.ci-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* --- Labels --- */
.ci-form-field label {
    display: block;
    font-family: var(--ci-font-body), -apple-system, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ci-dark);
    margin-bottom: 0.35rem;
}

.ci-form-required {
    color: var(--ci-accent-red);
}

/* --- Inputs, Textarea, Select --- */
.ci-form input[type="text"],
.ci-form input[type="email"],
.ci-form input[type="tel"],
.ci-form textarea,
.ci-form select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--ci-border);
    border-radius: 10px;
    font-family: var(--ci-font-body), -apple-system, sans-serif;
    font-size: 1rem;
    color: var(--ci-dark);
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

/* --- Focus --- */
.ci-form input:focus,
.ci-form textarea:focus,
.ci-form select:focus {
    outline: none;
    border-color: var(--ci-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* --- Placeholder --- */
.ci-form input::placeholder,
.ci-form textarea::placeholder {
    color: var(--ci-text-subtle);
    opacity: 1;
}

/* --- Fehler-State --- */
.ci-form .ci-form-has-error {
    border-color: var(--ci-accent-red) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.ci-form-field-error {
    display: block;
    font-size: 0.8rem;
    color: var(--ci-accent-red);
    margin-top: 0.3rem;
    min-height: 1.2em;
}

/* --- Submit Button --- */
.ci-form-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--ci-font-body), -apple-system, sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    background: var(--ci-primary);
    color: #fff;
    padding: 1.1rem 2rem;
    border: none;
    border-radius: var(--ci-border-radius-button);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.25);
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 0.5rem;
}

.ci-form-submit:hover {
    background: var(--ci-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(13, 148, 136, 0.35);
}

.ci-form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* --- Loading-Spinner (pure CSS, keine Font-Dependency) --- */
.ci-form-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ci-form-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 0.4rem;
}
@keyframes ci-form-spin {
    to { transform: rotate(360deg); }
}

/* --- SVG-Icons im Submit-Button --- */
.ci-form-submit svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.ci-form-submit:hover svg {
    transform: translateX(3px);
}

/* --- Honeypot (unsichtbar) --- */
.ci-form-honeypot {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* --- Erfolgs-Nachricht --- */
.ci-form-success-inner {
    text-align: center;
    padding: 2rem 1rem;
}

.ci-form-success-icon {
    width: 64px;
    height: 64px;
    background: var(--ci-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    animation: ci-form-pop 0.5s ease;
}

.ci-form-success-icon svg {
    color: #fff;
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
}

.ci-form-success h3 {
    font-family: var(--ci-font-heading), -apple-system, sans-serif;
    color: var(--ci-dark);
    margin-bottom: 0.75rem;
}

.ci-form-success p {
    color: var(--ci-text);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

@keyframes ci-form-pop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Fehler-Banner --- */
.ci-form-error {
    background: #fef2f2;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

.ci-form-error p {
    color: var(--ci-accent-red);
    font-size: 0.95rem;
    margin: 0;
}

/* --- Checkbox --- */
.ci-form-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.ci-form-checkbox-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 0.15rem;
    accent-color: var(--ci-primary);
    cursor: pointer;
}

.ci-form-checkbox-wrapper label {
    display: inline;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--ci-text);
    cursor: pointer;
    line-height: 1.5;
    margin-bottom: 0;
}

.ci-form-checkbox-wrapper label a {
    color: var(--ci-primary);
    text-decoration: underline;
}

.ci-form-checkbox-wrapper label a:hover {
    color: var(--ci-primary-dark);
}

/* --- Outreach-Links (Telegram/WhatsApp Deep-Links nach Submit) --- */
.ci-form-outreach {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ci-border, #e2e8f0);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ci-form-outreach-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    background: var(--ci-primary, #0d9488);
    color: #fff;
    border-radius: var(--ci-border-radius-button, 8px);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.15s;
}

.ci-form-outreach-link:hover {
    background: var(--ci-primary-dark, #0f766e);
    color: #fff;
}

.ci-form-outreach-link::before {
    content: "";
    width: 18px;
    height: 18px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.ci-form-outreach-telegram::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M21.42 2.18 2.6 9.59c-1.28.5-1.27 1.24-.23 1.55l4.83 1.5 1.86 5.71c.22.62.11.86.76.86.5 0 .72-.23 1-.5l2.42-2.36 5.02 3.7c.93.51 1.59.25 1.82-.85L23.4 4.16c.34-1.39-.54-2.02-1.98-1.98z'/></svg>");
}

.ci-form-outreach-whatsapp::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M17.5 14.4c-.3-.2-1.8-.9-2-.9-.3-.1-.5-.2-.6.1-.2.3-.7.9-.9 1.1-.2.2-.3.2-.6 0-.3-.2-1.3-.5-2.4-1.5-.9-.8-1.5-1.8-1.7-2.1-.2-.3 0-.5.1-.7.1-.1.3-.4.5-.5.1-.2.2-.3.3-.5.1-.2 0-.4 0-.5 0-.2-.6-1.6-.9-2.2-.2-.5-.5-.5-.6-.5h-.6c-.2 0-.5.1-.7.4-.3.3-1 .9-1 2.3 0 1.4 1 2.8 1.2 2.9.2.2 2 3 4.8 4.2.7.3 1.2.5 1.6.6.7.2 1.3.2 1.8.1.5-.1 1.7-.7 2-1.4.2-.7.2-1.2.1-1.4-.1-.2-.3-.2-.5-.3zM12 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z'/></svg>");
}

.ci-form-outreach-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ci-text-subtle, #64748b);
    text-align: center;
}

/* --- Responsive (Mobile) --- */
@media (max-width: 639px) {
    .ci-form-row {
        grid-template-columns: 1fr;
    }

    .ci-form-submit {
        font-size: 1rem;
        padding: 0.95rem 1.5rem;
    }
}
