/**
 * Punktwerk CRM Connect - Formular-Styles
 * Responsives Design, kompatibel mit den meisten WP-Themes.
 */

/* ===== Grundlayout ===== */
.pw-form-wrapper {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.5rem;
    line-height: 1.5;
    color: #333;
}
.pw-form-wrapper * { box-sizing: border-box; }

.pw-form-title {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

/* ===== Grid ===== */
.pw-form-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.pw-col-2 { flex: 0 0 calc(16.666% - 0.625rem); min-width: 80px; }
.pw-col-4 { flex: 0 0 calc(33.333% - 0.5rem); min-width: 120px; }
.pw-col-6 { flex: 0 0 calc(50% - 0.375rem); min-width: 180px; }
.pw-col-8 { flex: 0 0 calc(66.666% - 0.25rem); min-width: 200px; }

@media (max-width: 600px) {
	.pw-form-row.stack > .pw-form-group {
		flex: 0 0 100%;
	}
}
/* ===== Form Groups ===== */
.pw-form-group {
    margin-bottom: 1rem;
}
.pw-form-group label {
    /* display: block;
    font-weight: 600;
    margin-bottom: 0.3rem; */
	font-size: 0.8em;
}
.pw-form-group label small {
    font-weight: 400;
    color: #6c757d;
}

/* ===== Inputs ===== */
.pw-form input[type="text"],
.pw-form input[type="email"],
.pw-form input[type="tel"],
.pw-form input[type="number"],
.pw-form input[type="date"],
.pw-form input[type="url"],
.pw-form select,
.pw-form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    /* border: 1px solid #ced4da; */
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}
.pw-form input:focus,
.pw-form select:focus,
.pw-form textarea:focus {
    border-color: var(--wp--preset--color--1);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
    outline: none;
}
.pw-form input.pw-invalid,
.pw-form select.pw-invalid {
    border-color: #dc3545;
}

/* Input mit Einheit */
.pw-input-with-unit {
    display: flex;
    align-items: stretch;
}
.pw-input-with-unit input {
    border-radius: 6px 0 0 6px !important;
    flex: 1;
}
.pw-input-with-unit .pw-unit {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    background: #fff;
    border: 1px solid #000;
    border-left: none;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    color: #495057;
    white-space: nowrap;
}

/* File Input */
.pw-file-input {
    padding: 0.5rem !important;
    background: #f8f9fa !important;
}

/* ===== Checkboxen ===== */
.pw-checkbox-group { margin-top: 0.5rem; }
.pw-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 400 !important;
    cursor: pointer;
}
.pw-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ===== Fehlermeldungen ===== */
.pw-error-msg {
    display: block;
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.2rem;
    min-height: 1rem;
}
.pw-required { color: #dc3545; }
.pw-help-text {
    display: block;
    /* color: #6c757d; */
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* ===== Buttons ===== */
.pw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 100px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.pw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.pw-btn-primary {
    background: var(--wp--preset--color--1);
    color: #fff;
}
.pw-btn-primary:hover:not(:disabled) {
    background: var(--wp--preset--color--contrast);
}
.pw-btn-secondary {
    background: transparent;
    color: rgba(0,0,0,0.6);
	/* border: 1px solid #000; */
}
.pw-btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.5);
}

.pw-form-submit {
    margin-top: 1.25rem;
}
.pw-form-submit .pw-btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 1.05rem;
}

/* ===== Erfolgs-/Fehlermeldung ===== */
.pw-form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    font-weight: 500;
}
.pw-form-message.pw-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}
.pw-form-message.pw-error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* ===== H4 Sections ===== */
.pw-form h4 {
    font-size: 1.05rem;
    margin: 1.25rem 0 0.5rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}



.collapse .collapse-toggle {
	display: none;
}
.collapse > div {
	height: 0;
	overflow: hidden;
	max-height: 0;
	transition: all 0.5s;
}
.collapse > input:checked ~ div {
	height: auto;
	max-height: 500px;
}
.collapse > label {
	display:block;
}
.collapse > label h4 {
	position: relative;
	width: 100%;
}
.collapse > label h4:after {
	content:'▾';
	display: block;
	position: absolute;
	right: 0;
	top:0;
	width: 20px;
	height: 20px;
	line-height: 20px;
	text-align: center;
	transition: all 0.5s;
	color: rgba(0,0,0,0.5);
}
.collapse input:checked + label h4:after {
	transform: rotate(180deg);
}