/**
 * cancelButton by techNEO - Frontend CSS
 * Modernes Design mit Sektions-Layout
 */

/* ========================================
   Container & Grundstruktur
   ======================================== */

.tn-cb-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.tn-cb-header {
    text-align: center;
    margin-bottom: 35px;
}

.tn-cb-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
    text-align: center;
}

.tn-cb-subtitle {
    font-size: 0.95rem;
    color: #6c757d;
    margin: 0;
}

/* ========================================
   Meldungen (Erfolg/Fehler)
   ======================================== */

.tn-cb-messages {
    margin-bottom: 25px;
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.tn-cb-messages.tn-cb-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    color: #155724;
}

.tn-cb-messages.tn-cb-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #dc3545;
    color: #721c24;
}

.tn-cb-success-box,
.tn-cb-error-box {
    text-align: center;
    padding: 50px 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.tn-cb-success-box {
    border-top: 4px solid #28a745;
}

.tn-cb-error-box {
    border-top: 4px solid #dc3545;
}

.tn-cb-success-icon,
.tn-cb-error-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.tn-cb-success-icon {
    color: #28a745;
}

.tn-cb-error-icon {
    color: #dc3545;
}

.tn-cb-success-box h2,
.tn-cb-error-box h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a2e;
}

.tn-cb-success-box p,
.tn-cb-error-box p {
    color: #6c757d;
    margin-bottom: 0;
}

/* ========================================
   Formular Sektionen
   ======================================== */

.tn-cb-form {
    display: block;
}

.tn-cb-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.tn-cb-section-header {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e9ecef;
}

.tn-cb-section-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #14AAF5 0%, #0B6AA2 100%);
    color: #fff;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 14px;
    flex-shrink: 0;
}

.tn-cb-section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.tn-cb-section-content {
    padding: 24px;
}

.tn-cb-section-final {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
}

.tn-cb-section-final .tn-cb-section-header {
    display: none;
}

/* ========================================
   Formular Zeilen & Spalten
   ======================================== */

.tn-cb-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    margin-bottom: 16px;
}

.tn-cb-row:last-child {
    margin-bottom: 0;
}

.tn-cb-col {
    flex: 1;
    min-width: 200px;
    padding: 0 10px;
}

.tn-cb-col-full {
    flex: 0 0 100%;
    max-width: 100%;
}

/* ========================================
   Formularfelder
   ======================================== */

.tn-cb-field {
    margin-bottom: 8px;
}

.tn-cb-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
}

.tn-cb-field input[type="text"],
.tn-cb-field input[type="email"],
.tn-cb-field select,
.tn-cb-field textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    color: #1a1a2e;
    transition: all 0.2s ease;
    outline: none;
}

.tn-cb-field input:focus,
.tn-cb-field select:focus,
.tn-cb-field textarea:focus {
    border-color: #14AAF5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(20, 170, 245, 0.15);
}

.tn-cb-field input::placeholder,
.tn-cb-field textarea::placeholder {
    color: #adb5bd;
}

.tn-cb-field select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fafafa;
    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='%23495057' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* Custom Select Dropdown */
.tn-cb-select-wrapper {
    position: relative;
    width: 100%;
}

.tn-cb-select-wrapper select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tn-cb-select-display {
    width: 100%;
    padding: 12px 14px;
    padding-right: 40px;
    font-size: 0.95rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.tn-cb-select-display::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #495057;
    transition: transform 0.2s ease;
}

.tn-cb-select-wrapper.tn-cb-select-open .tn-cb-select-display::after {
    transform: translateY(-50%) rotate(180deg);
}

.tn-cb-select-display:hover,
.tn-cb-select-wrapper.tn-cb-select-open .tn-cb-select-display {
    border-color: #14AAF5;
    background: #fff;
}

.tn-cb-select-display.tn-cb-placeholder {
    color: #adb5bd;
}

.tn-cb-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 2px solid #14AAF5;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.tn-cb-select-wrapper.tn-cb-select-open .tn-cb-select-options {
    display: block;
    animation: tn-cb-dropdownFade 0.2s ease;
}

@keyframes tn-cb-dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tn-cb-select-option {
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.tn-cb-select-option:last-child {
    border-bottom: none;
}

.tn-cb-select-option:hover {
    background: #e7f5ff;
    color: #0B6AA2;
}

.tn-cb-select-option.tn-cb-selected {
    background: #14AAF5;
    color: #fff;
}

.tn-cb-select-option.tn-cb-disabled {
    color: #adb5bd;
    cursor: default;
}

.tn-cb-select-option.tn-cb-disabled:hover {
    background: transparent;
    color: #adb5bd;
}

/* Validierung für Custom Select */
.tn-cb-field.tn-cb-invalid .tn-cb-select-display {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.tn-cb-field.tn-cb-valid .tn-cb-select-display {
    border-color: #28a745;
}

.tn-cb-field textarea {
    resize: vertical;
    min-height: 100px;
}

.tn-cb-hint {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 4px;
}

/* Validierung */
.tn-cb-required .tn-cb-error {
    display: none;
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 4px;
}

.tn-cb-field.tn-cb-invalid input,
.tn-cb-field.tn-cb-invalid select,
.tn-cb-field.tn-cb-invalid textarea {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.tn-cb-field.tn-cb-invalid .tn-cb-error {
    display: block;
}

.tn-cb-field.tn-cb-valid input,
.tn-cb-field.tn-cb-valid select {
    border-color: #28a745;
}

/* Textarea Footer */
.tn-cb-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.tn-cb-charcount {
    font-size: 0.8rem;
    color: #adb5bd;
}

.tn-cb-charcount.tn-cb-warning {
    color: #ffc107;
}

.tn-cb-charcount.tn-cb-danger {
    color: #dc3545;
}

/* ========================================
   Checkbox & Datenschutz
   ======================================== */

.tn-cb-legal {
    padding: 20px 24px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
}

.tn-cb-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.tn-cb-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #14AAF5;
    cursor: pointer;
    flex-shrink: 0;
}

.tn-cb-checkbox label {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.5;
    cursor: pointer;
}

.tn-cb-checkbox label a {
    color: #14AAF5;
    text-decoration: none;
}

.tn-cb-checkbox label a:hover {
    text-decoration: underline;
}

.tn-cb-checkbox .tn-cb-error {
    display: none;
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 4px;
    margin-left: 32px;
}

.tn-cb-checkbox.tn-cb-invalid .tn-cb-error {
    display: block;
}

.tn-cb-policy-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #e7f5ff;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #0c5460;
}

.tn-cb-policy-hint i {
    color: #14AAF5;
    margin-top: 2px;
}

.tn-cb-policy-hint a {
    color: #0B6AA2;
    text-decoration: none;
}

.tn-cb-policy-hint a:hover {
    text-decoration: underline;
}

/* ========================================
   Captcha
   ======================================== */

.tn-cb-captcha {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

/* ========================================
   Submit Button
   ======================================== */

.tn-cb-submit {
    text-align: center;
}

.tn-cb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #14AAF5 0%, #0B6AA2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(20, 170, 245, 0.3);
}

.tn-cb-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 170, 245, 0.4);
}

.tn-cb-btn:active {
    transform: translateY(0);
}

.tn-cb-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.tn-cb-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   Footer Button (Hook)
   ======================================== */

.tn-cb-footer-wrapper {
    text-align: center;
    padding: 20px;
    background: transparent !important;
}

.tn-cb-footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff !important;
    background: linear-gradient(135deg, #14AAF5 0%, #0B6AA2 100%);
    border: none;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(20, 170, 245, 0.25);
}

.tn-cb-footer-btn span,
.tn-cb-footer-btn i {
    color: #fff !important;
}

.tn-cb-footer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(20, 170, 245, 0.35);
    color: #fff !important;
    text-decoration: none !important;
}

.tn-cb-footer-btn:visited,
.tn-cb-footer-btn:active,
.tn-cb-footer-btn:focus {
    color: #fff !important;
    text-decoration: none !important;
}

.tn-cb-footer-btn i {
    font-size: 1rem;
}

/* Secondary Button */
.tn-cb-footer-btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 3px 12px rgba(108, 117, 125, 0.25);
}

.tn-cb-footer-btn-secondary:hover {
    box-shadow: 0 5px 18px rgba(108, 117, 125, 0.35);
}

/* Outline Button */
.tn-cb-footer-btn-outline {
    background: transparent !important;
    border: 2px solid #14AAF5 !important;
    color: #14AAF5 !important;
    box-shadow: none !important;
}

.tn-cb-footer-btn-outline span,
.tn-cb-footer-btn-outline i {
    color: #14AAF5 !important;
}

.tn-cb-footer-btn-outline:hover {
    background: #14AAF5 !important;
    color: #fff !important;
    box-shadow: 0 5px 18px rgba(20, 170, 245, 0.35) !important;
}

.tn-cb-footer-btn-outline:hover span,
.tn-cb-footer-btn-outline:hover i {
    color: #fff !important;
}

.tn-cb-footer-btn-outline:visited,
.tn-cb-footer-btn-outline:active,
.tn-cb-footer-btn-outline:focus {
    color: #14AAF5 !important;
}

/* Link Style Button */
.tn-cb-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #14AAF5 !important;
    background: transparent !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.tn-cb-footer-link span,
.tn-cb-footer-link i {
    color: #14AAF5 !important;
}

.tn-cb-footer-link:hover {
    color: #0B6AA2 !important;
    text-decoration: underline !important;
}

.tn-cb-footer-link:hover span,
.tn-cb-footer-link:hover i {
    color: #0B6AA2 !important;
}

.tn-cb-footer-link:visited,
.tn-cb-footer-link:active,
.tn-cb-footer-link:focus {
    color: #14AAF5 !important;
}

/* ========================================
   Honeypot (versteckt)
   ======================================== */

[aria-hidden="true"] input[name="tn_cb_website"] {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .tn-cb-container {
        padding: 20px 15px;
    }

    .tn-cb-title {
        font-size: 1.4rem;
    }

    .tn-cb-section-header {
        padding: 14px 18px;
    }

    .tn-cb-section-content {
        padding: 18px;
    }

    .tn-cb-col {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 12px;
    }

    .tn-cb-col:last-child {
        margin-bottom: 0;
    }

    .tn-cb-btn {
        width: 100%;
        padding: 14px 24px;
    }

    .tn-cb-legal {
        padding: 16px;
    }

    .tn-cb-success-box,
    .tn-cb-error-box {
        padding: 35px 20px;
    }
}

@media (max-width: 480px) {
    .tn-cb-title {
        font-size: 1.25rem;
    }

    .tn-cb-section-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .tn-cb-section-header h2 {
        font-size: 1rem;
    }
}

/* ========================================
   Animation
   ======================================== */

@keyframes tn-cb-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.tn-cb-field.tn-cb-shake {
    animation: tn-cb-shake 0.5s ease-in-out;
}

@keyframes tn-cb-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tn-cb-messages {
    animation: tn-cb-fadeIn 0.3s ease-out;
}

/* ========================================
   Modal Popup
   ======================================== */

.tn-cb-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.tn-cb-modal.tn-cb-modal-open {
    display: flex;
    animation: tn-cb-modalFadeIn 0.2s ease-out;
}

.tn-cb-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: tn-cb-modalSlideIn 0.3s ease-out;
}

.tn-cb-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1;
}

.tn-cb-modal-close:hover {
    background: #e9ecef;
    color: #1a1a2e;
}

.tn-cb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.tn-cb-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
}

.tn-cb-modal-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    min-height: 200px;
    max-height: 70vh;
}

.tn-cb-modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #14AAF5;
    background: #fff;
}

.tn-cb-modal-loading p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.tn-cb-modal-iframe {
    width: 100%;
    height: 70vh;
    border: none;
    display: block;
    background: #fff;
}

.tn-cb-modal-text {
    padding: 25px;
    line-height: 1.7;
    color: #374151;
    font-size: 0.95rem;
}

.tn-cb-modal-text h1,
.tn-cb-modal-text h2,
.tn-cb-modal-text h3,
.tn-cb-modal-text h4 {
    color: #1a1a2e;
    margin: 1.5em 0 0.75em 0;
}

.tn-cb-modal-text h1:first-child,
.tn-cb-modal-text h2:first-child,
.tn-cb-modal-text h3:first-child {
    margin-top: 0;
}

.tn-cb-modal-text p {
    margin: 0 0 1em 0;
}

.tn-cb-modal-text ul,
.tn-cb-modal-text ol {
    margin: 0 0 1em 0;
    padding-left: 1.5em;
}

.tn-cb-modal-text li {
    margin-bottom: 0.5em;
}

.tn-cb-modal-text a {
    color: #14AAF5;
    text-decoration: underline;
}

.tn-cb-modal-text a:hover {
    color: #0B6AA2;
}

.tn-cb-modal-error {
    text-align: center;
    color: #dc3545;
    padding: 40px 20px;
}

@keyframes tn-cb-modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tn-cb-modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .tn-cb-modal {
        padding: 10px;
    }

    .tn-cb-modal-content {
        max-height: 95vh;
        border-radius: 8px;
    }

    .tn-cb-modal-header {
        border-radius: 8px 8px 0 0;
    }

    #tn-cb-modal-iframe {
        min-height: 400px;
    }
}
