/**
 * PraxisIQ Beitrittserklärung — frontend form styles.
 * Brand tokens: --primary #0C4A6E, --secondary #0891B2, --accent #0D9488.
 * Keeps the same CSS variables as the theme so the form inherits
 * the site's look automatically.
 */

.pm-form-wrapper {
    max-width: 820px;
    margin: 0 auto;
    --pm-primary:   var(--primary,   #0C4A6E);
    --pm-secondary: var(--secondary, #0891B2);
    --pm-accent:    var(--accent,    #0D9488);
    --pm-gray-100:  #F1F5F9;
    --pm-gray-200:  #E2E8F0;
    --pm-gray-500:  #64748B;
    --pm-gray-700:  #334155;
    --pm-gray-800:  #1E293B;
    font-family: inherit;
}

.pm-form-header { text-align: center; margin-bottom: 2rem; }
.pm-form-header h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.25rem;
    color: var(--pm-primary);
    margin: 0 0 0.3em;
    letter-spacing: -0.02em;
}
.pm-form-subtitle { font-size: 1rem; color: var(--pm-gray-700); margin: 0; }
.pm-form-info     { font-size: 0.85rem; color: var(--pm-gray-500); margin-top: 0.3em; }

.pm-form-wrapper fieldset {
    border: none;
    padding: 0;
    margin: 0 0 2rem;
}
.pm-form-wrapper legend {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--pm-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--pm-secondary);
    margin-bottom: 1.2rem;
    width: 100%;
    display: block;
}

.pm-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.5rem;
}
.pm-row:has(.pm-col:nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
.pm-row:has(.pm-col:first-child:last-child)  { grid-template-columns: 1fr; }
.pm-col { display: flex; flex-direction: column; }
.pm-col--small { max-width: 180px; }

.pm-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pm-gray-700);
    margin-bottom: 0.3rem;
}

.pm-form-wrapper input[type="text"],
.pm-form-wrapper input[type="email"],
.pm-form-wrapper input[type="tel"],
.pm-form-wrapper input[type="date"],
.pm-form-wrapper select,
.pm-form-wrapper textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1.5px solid var(--pm-gray-200);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: var(--pm-gray-800);
}
.pm-form-wrapper input:focus,
.pm-form-wrapper select:focus,
.pm-form-wrapper textarea:focus {
    outline: none;
    border-color: var(--pm-secondary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}
.pm-form-wrapper input.pm-error,
.pm-form-wrapper select.pm-error {
    border-color: #d63638;
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1);
}

/* ---------- Tier radio cards ---------- */
.pm-radio-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.pm-radio-card {
    position: relative;
    border: 2px solid var(--pm-gray-200);
    border-radius: 14px;
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: #fff;
}
.pm-radio-card:hover {
    border-color: var(--pm-secondary);
    background: rgba(8, 145, 178, 0.02);
    transform: translateY(-2px);
}
.pm-radio-card.selected,
.pm-radio-card:has(input:checked) {
    border-color: var(--pm-secondary);
    background: rgba(8, 145, 178, 0.04);
    box-shadow: 0 0 0 1px var(--pm-secondary);
}
.pm-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.pm-radio-card--featured {
    border-color: var(--pm-accent);
}
.pm-radio-card--featured.selected,
.pm-radio-card--featured:has(input:checked) {
    box-shadow: 0 0 0 1px var(--pm-accent);
}

.pm-featured-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--pm-secondary), var(--pm-accent));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.pm-tier-icon {
    font-size: 1.6rem;
    color: var(--pm-secondary);
    margin-bottom: 0.3em;
    line-height: 1;
}

.pm-radio-content strong {
    display: block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    color: var(--pm-primary);
    margin-bottom: 0.3em;
}
.pm-price {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--pm-accent);
    margin-bottom: 0.4em;
}
.pm-price small { font-size: 0.7em; font-weight: 500; color: var(--pm-gray-500); }
.pm-tier-desc {
    font-size: 0.8rem;
    color: var(--pm-gray-500);
    line-height: 1.3;
}

/* ---------- Legal / consents ---------- */
.pm-legal-text {
    font-size: 0.85rem;
    color: var(--pm-gray-700);
    line-height: 1.6;
    padding: 1rem 1.25rem;
    background: #F8FAFC;
    border: 1px solid var(--pm-gray-200);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.pm-checkbox-group { margin-top: 0.5rem; }
.pm-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--pm-gray-700);
}
.pm-checkbox input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--pm-secondary);
}
.pm-checkbox a { color: var(--pm-secondary); text-decoration: underline; }

/* ---------- Signature ---------- */
.pm-sig-hint { font-size: 0.85rem; color: var(--pm-gray-500); margin-bottom: 0.5rem; }
.pm-signature-wrapper {
    border: 2px dashed var(--pm-gray-200);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    cursor: crosshair;
}
.pm-signature-wrapper canvas { display: block; width: 100%; touch-action: none; }

.pm-btn-link {
    background: none;
    border: none;
    color: var(--pm-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0.3rem 0;
    font-family: inherit;
}
.pm-btn-link:hover { color: var(--pm-primary); }

.pm-note {
    font-size: 0.8rem;
    color: var(--pm-gray-500);
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ---------- Messages & submit ---------- */
.pm-message {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}
.pm-message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.pm-message--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.pm-submit-area { margin-top: 1.5rem; }
.pm-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 2rem;
    background: var(--pm-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    font-family: inherit;
}
.pm-btn-primary:hover:not(:disabled) {
    background: var(--pm-secondary);
    transform: translateY(-1px);
}
.pm-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.pm-success {
    text-align: center;
    padding: 3rem 2rem;
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    border-radius: 16px;
}
.pm-success-icon { font-size: 3rem; margin-bottom: 1rem; }
.pm-success h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #166534;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}
.pm-success p {
    color: var(--pm-gray-700);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .pm-radio-group { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .pm-row           { grid-template-columns: 1fr; }
    .pm-radio-group   { grid-template-columns: 1fr; }
    .pm-col--small    { max-width: none; }
    .pm-form-header h2 { font-size: 1.8rem; }
}
