/* KM Forms — Tally-style multi-step form */

.kmf-wrap {
    display: flex;
    justify-content: center;
    padding: 0;
    width: 100%;
}

.kmf-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    max-width: 480px;
    width: 100%;
    padding: 32px;
    position: relative;
}

/* Progress bar */
.kmf-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #e5e7eb;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.kmf-progress-bar {
    height: 100%;
    background: #5d83f7;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header */
.kmf-header {
    margin-bottom: 24px;
    text-align: center;
}

.kmf-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    line-height: 1.3;
}

.kmf-subtitle {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Steps container */
.kmf-steps {
    position: relative;
}

/* Individual step */
.kmf-step {
    display: none;
    animation: kmfFadeIn 0.3s ease forwards;
}

.kmf-step--active {
    display: block;
}

/* Animations — fade only, no translate to avoid overflow clipping */
@keyframes kmfFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes kmfFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.kmf-step--exiting {
    display: block;
    animation: kmfFadeOut 0.2s ease forwards;
}

/* Label */
.kmf-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

/* Input */
.kmf-input {
    display: block;
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: #1a1a2e;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.kmf-input:focus {
    border-color: #5d83f7;
    box-shadow: 0 0 0 3px rgba(93, 131, 247, 0.15);
    background: #fff;
}

.kmf-input--error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Button */
.kmf-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    margin-top: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #5d83f7;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    -webkit-appearance: none;
}

.kmf-btn:hover {
    background: #4a6fe5;
}

.kmf-btn:active {
    transform: scale(0.98);
}

.kmf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading spinner on button */
.kmf-btn--loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.kmf-btn--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: kmfSpin 0.6s linear infinite;
}

@keyframes kmfSpin {
    to { transform: rotate(360deg); }
}

/* Success state */
.kmf-success {
    text-align: center;
    padding: 24px 0;
    animation: kmfFadeIn 0.4s ease;
}

.kmf-success-icon {
    margin-bottom: 16px;
}

.kmf-success-text {
    font-size: 1rem;
    color: #374151;
    font-weight: 500;
    margin: 0;
}

/* Error state */
.kmf-error {
    margin-top: 8px;
}

.kmf-error-text {
    font-size: 0.875rem;
    color: #ef4444;
    margin: 0;
    text-align: center;
}

/* Responsive */
@media (max-width: 540px) {
    .kmf-card {
        padding: 24px 20px;
        border-radius: 12px;
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
    }

    .kmf-title {
        font-size: 1.25rem;
    }

    .kmf-input, .kmf-btn {
        padding: 12px 14px;
    }
}

/* ========================================
   Minimal Theme (Wohnlab) — white card, black accents
   ======================================== */
.kmf-wrap--minimal .kmf-card {
    background: #fff;
    box-shadow: none;
    border: 1px solid #e0e0e0;
}

.kmf-wrap--minimal .kmf-progress {
    background: #e0e0e0;
}

.kmf-wrap--minimal .kmf-progress-bar {
    background: #1a1a1a;
}

.kmf-wrap--minimal .kmf-title {
    color: #1a1a1a;
}

.kmf-wrap--minimal .kmf-subtitle {
    color: #666;
}

.kmf-wrap--minimal .kmf-label {
    color: #333;
}

.kmf-wrap--minimal .kmf-input {
    background: #fafafa;
    border-color: #ddd;
    color: #1a1a1a;
}

.kmf-wrap--minimal .kmf-input::placeholder {
    color: #999;
}

.kmf-wrap--minimal .kmf-input:focus {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
    background: #fff;
}

.kmf-wrap--minimal .kmf-btn {
    background: #1a1a1a;
    color: #fff;
}

.kmf-wrap--minimal .kmf-btn:hover {
    background: #333;
}

.kmf-wrap--minimal .kmf-btn--loading::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

.kmf-wrap--minimal .kmf-success-text {
    color: #1a1a1a;
}

/* ========================================
   Dark Theme
   ======================================== */
.kmf-wrap--dark .kmf-card {
    background: #1a1a1a;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.kmf-wrap--dark .kmf-progress {
    background: rgba(255, 255, 255, 0.1);
}

.kmf-wrap--dark .kmf-progress-bar {
    background: #fff;
}

.kmf-wrap--dark .kmf-title {
    color: #fff;
}

.kmf-wrap--dark .kmf-subtitle {
    color: rgba(255, 255, 255, 0.6);
}

.kmf-wrap--dark .kmf-label {
    color: rgba(255, 255, 255, 0.7);
}

.kmf-wrap--dark .kmf-input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.kmf-wrap--dark .kmf-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.kmf-wrap--dark .kmf-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.1);
}

.kmf-wrap--dark .kmf-input--error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.kmf-wrap--dark .kmf-btn {
    background: #fff;
    color: #1a1a1a;
}

.kmf-wrap--dark .kmf-btn:hover {
    background: #e5e5e5;
}

.kmf-wrap--dark .kmf-btn--loading::after {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: #1a1a1a;
}

.kmf-wrap--dark .kmf-success-text {
    color: rgba(255, 255, 255, 0.9);
}

.kmf-wrap--dark .kmf-success-icon svg {
    stroke: #4ade80;
}

.kmf-wrap--dark .kmf-error-text {
    color: #f87171;
}
