/* ============================================================
   Röhrig Kontaktformular – Stylesheet
   ============================================================ */

/* ── Custom Properties ── */
:root {
    --mint-bg:        #f0fdf8;
    --mint-border:    #d1fae5;
    --mint-focus:     #059669;
    --red:            #c0392b;
    --red-hover:      #a93226;
    --gray-label:     #374151;
    --gray-hint:      #6b7280;
    --gray-border:    #e5e7eb;
    --error-color:    #dc2626;
    --success-color:  #059669;
    --font-base:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --radius:         6px;
    --radius-lg:      10px;
    --transition:     0.18s ease;
}

/* ── Wrapper ── */
.roehrig-form-wrapper {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 16px 40px;
    font-family: var(--font-base);
    color: var(--gray-label);
}

/* ── Header ── */
.roehrig-form-header {
    text-align: center;
    margin-bottom: 36px;
}

.roehrig-form-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 12px;
    line-height: 1.2;
}

.roehrig-form-header p {
    font-size: 1rem;
    color: var(--gray-hint);
    line-height: 1.65;
    max-width: 640px;
    margin: 0 auto;
}

/* ── Form Group ── */
.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.form-group label:not(.checkbox-label):not(.privacy-label) {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-label);
    margin-bottom: 6px;
}

.group-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-label);
    margin-bottom: 10px;
}

.req {
    color: var(--error-color);
    font-weight: 700;
    margin-left: 1px;
}

/* ── Inputs ── */
.form-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    background: var(--mint-bg);
    border: 1.5px solid var(--mint-border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: #1f2937;
    line-height: 1.4;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:hover {
    border-color: #a7f3d0;
}

.form-input:focus {
    border-color: var(--mint-focus);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.form-input.input-error {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
}

/* ── Select ── */
.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
}

/* ── Textarea ── */
.form-textarea {
    resize: vertical;
    min-height: 140px;
}

/* ── Multi-column Rows ── */
.form-row {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-row-2 {
    grid-template-columns: 1fr 1fr;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ── Phone Input ── */
.phone-wrapper {
    display: flex;
    gap: 8px;
}

.phone-country {
    width: auto;
    min-width: 108px;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.phone-number {
    flex: 1;
}

/* ── Hint Text ── */
.field-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--gray-hint);
    margin-top: 5px;
    font-style: italic;
}

/* ── Error Text ── */
.field-error {
    display: none;
    font-size: 0.8rem;
    color: var(--error-color);
    margin-top: 5px;
    font-weight: 500;
}

/* ── Checkbox Grid ── */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
}

/* ── Custom Checkboxes ── */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--gray-label);
    user-select: none;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    transition: border-color var(--transition), background var(--transition);
    margin-top: 1px;
}

.checkbox-custom::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2.5px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(42deg) translate(0px, -1px);
    opacity: 0;
    transition: opacity var(--transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--mint-focus);
    border-color: var(--mint-focus);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    opacity: 1;
}

.checkbox-label input[type="checkbox"]:focus + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.20);
}

.privacy-label {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-label);
}

.privacy-label a {
    color: var(--mint-focus);
    text-decoration: underline;
}

/* ── Upload Zones ── */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-lg);
    background: #fafafa;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    position: relative;
    margin-bottom: 12px;
}

.upload-zone:last-child {
    margin-bottom: 0;
}

.upload-zone:hover,
.upload-zone:focus-within {
    border-color: var(--mint-focus);
    background: var(--mint-bg);
}

.upload-zone.drag-over {
    border-color: var(--mint-focus);
    background: #ecfdf5;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.08);
}

.upload-zone.has-file {
    border-style: solid;
    border-color: var(--mint-focus);
    background: var(--mint-bg);
}

.file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.upload-content {
    pointer-events: none;
    color: var(--gray-hint);
}

.upload-content svg {
    color: #9ca3af;
    margin-bottom: 10px;
}

.upload-content p {
    margin: 0 0 4px;
    font-size: 0.9375rem;
}

.upload-hint {
    font-size: 0.78rem;
    color: #b0b9c7 !important;
}

/* ── Upload File Info ── */
.upload-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--mint-focus);
    font-weight: 500;
    pointer-events: auto;
}

.upload-info svg {
    flex-shrink: 0;
    color: var(--mint-focus);
}

.upload-info .file-name {
    word-break: break-all;
}

.remove-file {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color var(--transition), background var(--transition);
    flex-shrink: 0;
}

.remove-file:hover {
    color: var(--error-color);
    background: #fee2e2;
}

/* ── Error Banner ── */
.form-error-banner {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius);
    color: #991b1b;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ── Submit Area ── */
.form-submit-area {
    display: flex;
    justify-content: center;
    margin: 30px 0 20px;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 48px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.30);
    letter-spacing: 0.02em;
}

.submit-btn:hover:not(:disabled) {
    background: var(--red-hover);
    box-shadow: 0 4px 14px rgba(192, 57, 43, 0.38);
    transform: translateY(-1px);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ── Spinner Animation ── */
.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.spin {
    animation: spin 0.85s linear infinite;
}

/* ── Footer Notes ── */
.form-footer-notes {
    text-align: center;
    margin-top: 12px;
}

.required-note {
    font-size: 0.8125rem;
    color: var(--gray-hint);
    font-style: italic;
    margin: 0 0 8px;
}

.recaptcha-note {
    font-size: 0.76rem;
    color: #9ca3af;
    margin: 0;
    line-height: 1.6;
}

.recaptcha-note a {
    color: #9ca3af;
    text-decoration: underline;
}

/* ── Success Message ── */
.roehrig-success {
    text-align: center;
    padding: 60px 20px;
    animation: fadeInUp 0.5s ease both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.success-icon {
    color: var(--success-color);
    margin-bottom: 20px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s both;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
}

.roehrig-success h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 14px;
}

.roehrig-success p {
    font-size: 1rem;
    color: var(--gray-hint);
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .form-row-3,
    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .phone-wrapper {
        flex-direction: column;
    }

    .phone-country {
        width: 100%;
    }

    .roehrig-form-header h1 {
        font-size: 1.5rem;
    }

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

@media (max-width: 480px) {
    .roehrig-form-wrapper {
        padding: 0 8px 32px;
    }
}
