/* Tönsberg Schadensformular */

.tbsf-container {
    --tbsf-blue: #0a3aa3;
    --tbsf-blue-dark: #082b78;
    --tbsf-accent: #00a8e8;
    --tbsf-danger: #d92d20;
    --tbsf-success: #00b96b;
    --tbsf-text: #1a1a1a;
    --tbsf-muted: #667085;
    --tbsf-border: #d7dce5;
    --tbsf-bg-soft: #f5f7fb;

    max-width: 620px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 30px rgba(10, 58, 163, 0.08);
    padding: 28px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--tbsf-text);
    line-height: 1.5;
}

.tbsf-container *,
.tbsf-container *::before,
.tbsf-container *::after {
    box-sizing: border-box;
}

/* Header */
.tbsf-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.tbsf-header-icon {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--tbsf-blue), var(--tbsf-accent));
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbsf-header-text h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--tbsf-text);
    line-height: 1.2;
}

.tbsf-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--tbsf-muted);
}

/* Notfall-Anrufleiste */
.tbsf-callbar {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    background: linear-gradient(135deg, var(--tbsf-blue), var(--tbsf-blue-dark));
    color: #ffffff;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    transition: transform .15s ease, box-shadow .15s ease;
}

/* Theme-Linkfarben überschreiben, damit der Text immer weiß/lesbar bleibt */
.tbsf-container .tbsf-callbar,
.tbsf-container .tbsf-callbar:link,
.tbsf-container .tbsf-callbar:visited,
.tbsf-container .tbsf-callbar:hover,
.tbsf-container .tbsf-callbar:focus,
.tbsf-container .tbsf-callbar:active,
.tbsf-container .tbsf-callbar:hover * {
    color: #ffffff;
    text-decoration: none;
}

.tbsf-callbar:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(10, 58, 163, 0.25);
}

.tbsf-callbar-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbsf-callbar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.tbsf-callbar-text strong {
    font-size: 14px;
    font-weight: 600;
}

.tbsf-callbar-text span {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .3px;
}

/* Felder */
.tbsf-field {
    margin-bottom: 20px;
}

.tbsf-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--tbsf-text);
    margin-bottom: 8px;
}

.tbsf-required {
    color: var(--tbsf-danger);
}

.tbsf-optional {
    color: var(--tbsf-muted);
    font-weight: 400;
    font-size: 13px;
}

.tbsf-hint {
    display: block;
    font-size: 13px;
    color: var(--tbsf-muted);
    margin-top: 6px;
}

.tbsf-form input[type="text"],
.tbsf-form input[type="tel"],
.tbsf-form input[type="email"],
.tbsf-form textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px; /* >=16px verhindert Zoom auf iOS */
    font-family: inherit;
    color: var(--tbsf-text);
    background: #ffffff;
    border: 1.5px solid var(--tbsf-border);
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.tbsf-form input::placeholder,
.tbsf-form textarea::placeholder {
    color: #9aa3b2;
}

.tbsf-form input:focus,
.tbsf-form textarea:focus {
    outline: none;
    border-color: var(--tbsf-accent);
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.15);
}

.tbsf-form textarea {
    resize: vertical;
    min-height: 56px;
}

/* Feldfehler */
.tbsf-field.tbsf-has-error input,
.tbsf-field.tbsf-has-error textarea {
    border-color: var(--tbsf-danger);
}

.tbsf-field-error {
    display: block;
    color: var(--tbsf-danger);
    font-size: 13px;
    margin-top: 6px;
}

/* Chips (Schnellauswahl) */
.tbsf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tbsf-chip {
    position: relative;
    cursor: pointer;
}

.tbsf-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tbsf-chip span {
    display: inline-block;
    padding: 9px 14px;
    border: 1.5px solid var(--tbsf-border);
    border-radius: 999px;
    font-size: 14px;
    color: var(--tbsf-text);
    background: #ffffff;
    transition: all .15s ease;
    user-select: none;
}

.tbsf-chip input:checked + span {
    border-color: var(--tbsf-blue);
    background: var(--tbsf-blue);
    color: #ffffff;
}

.tbsf-chip input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.25);
}

/* Honeypot – unsichtbar für Menschen */
.tbsf-hp {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Submit */
.tbsf-submit {
    position: relative;
    width: 100%;
    padding: 16px;
    margin-top: 4px;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--tbsf-blue), var(--tbsf-accent));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.tbsf-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(10, 58, 163, 0.28);
}

.tbsf-submit:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tbsf-spinner {
    display: none;
    width: 18px;
    height: 18px;
    margin-left: 10px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    vertical-align: middle;
    animation: tbsf-spin .7s linear infinite;
}

.tbsf-form.tbsf-loading .tbsf-spinner {
    display: inline-block;
}

@keyframes tbsf-spin {
    to { transform: rotate(360deg); }
}

/* Meldungen */
.tbsf-messages {
    display: none;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
}

.tbsf-messages.tbsf-error {
    display: block;
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.tbsf-privacy {
    font-size: 12px;
    color: var(--tbsf-muted);
    margin: 16px 0 0;
}

/* Erfolg */
.tbsf-success {
    text-align: center;
    padding: 24px 8px;
}

.tbsf-success-icon {
    margin-bottom: 12px;
}

.tbsf-success h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--tbsf-text);
}

.tbsf-success p {
    margin: 0;
    color: var(--tbsf-muted);
    font-size: 15px;
}

/* Responsive */
@media (max-width: 480px) {
    .tbsf-container {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .tbsf-header-text h2 {
        font-size: 19px;
    }

    .tbsf-callbar-text span {
        font-size: 16px;
    }
}
