/**
 * Verbindung - Newsletter Signup Styles
 * Lückentext-Design, Progress Walker, Letter Animation
 */

/* ===== Letter Animation ===== */
.letter-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.letter {
    width: 48px;
    height: 36px;
    position: relative;
    animation: flutter 2.5s ease-in-out 2 forwards;
    cursor: default;
    opacity: 0.7;
}

.letter-body {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-secondary-light, #b57aa5), var(--color-secondary, #966489));
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.letter-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(135deg, #e0c0d9, var(--color-secondary-light, #b57aa5));
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    transform-origin: top center;
    animation: flapWave 1.25s ease-in-out 4 forwards;
}

.letter-heart {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #fff;
    animation: heartBeat 1s ease-in-out 5 forwards;
}

@keyframes flutter {
    0% { transform: translateX(0) rotate(-2deg); }
    25% { transform: translateX(8px) rotate(1deg); }
    50% { transform: translateX(0) rotate(2deg); }
    75% { transform: translateX(-8px) rotate(-1deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

@keyframes flapWave {
    0%, 100% { transform: rotateX(0deg); }
    50% { transform: rotateX(15deg); }
}

@keyframes heartBeat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

/* ===== Topic Selection ===== */
.topic-checkboxes-vertical {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: var(--space-3) 0 var(--space-4) var(--space-4);
}

.topic-checkbox-vertical {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.topic-checkbox-vertical input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-success, #22c55e);
    border-radius: 3px;
}

.topic-checkbox-vertical input[type="checkbox"]:focus {
    outline: none;
    animation: checkboxGlow 0.4s ease-out;
}

@keyframes checkboxGlow {
    0% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); }
    100% { box-shadow: none; }
}

.topic-checkbox-vertical span {
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
}

/* ===== Signup Container ===== */
.newsletter-signup-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* ===== Lückentext Design ===== */
.lueckentext {
    font-size: 1.3rem;
    line-height: 2.8;
    text-align: left;
}

.lueckentext-line {
    margin: 0;
}

.lueckentext-spacing {
    margin-top: 1.5rem;
}

/* ===== Inline Input Fields ===== */
.inline-field {
    display: inline-block;
    vertical-align: middle;
    margin: 0 var(--space-1);
}

.inline-field input {
    padding: var(--space-2) var(--space-3);
    border: 2px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    font-family: inherit;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    width: 8rem;
    transition: border-color var(--transition-fast);
}

.inline-field input:focus {
    outline: none;
    border-color: var(--color-primary);
    animation: focusGlow 0.4s ease-out;
}

@keyframes focusGlow {
    0% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.2); }
    100% { box-shadow: 0 0 0 3px rgba(33, 88, 143, 0.1); }
}

.inline-field input::placeholder {
    color: var(--color-text-muted);
}

.inline-field-wide input {
    width: 12rem;
}

.inline-field-email input {
    width: 16rem;
}

.floating-label {
    display: none;
}

/* ===== Field Errors ===== */
.inline-field.field-error input {
    animation: errorGlow 0.5s ease-out;
}

@keyframes errorGlow {
    0% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.3); }
    100% { box-shadow: none; }
}

.inline-field .field-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--color-error, #dc3545);
    margin-top: 2px;
    line-height: 1.2;
}

.topic-checkboxes-vertical.field-error {
    animation: errorGlow 0.5s ease-out;
}

.topic-checkboxes-vertical .field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--color-error, #dc3545);
    margin-top: var(--space-1);
}

/* ===== Progress Walker ===== */
.progress-walker-container {
    margin: var(--space-md) 0;
    text-align: center;
}

.progress-walker-canvas {
    max-width: 400px;
    height: 60px;
    display: block;
    margin: 0 auto;
}

/* ===== Code Form ===== */
.newsletter-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.newsletter-code-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-weight: bold;
    max-width: 12ch;
    padding: 0.5rem;
    border: 2px solid var(--color-border, #ccc);
    border-radius: 4px;
}

.newsletter-code-input:focus {
    outline: none;
    border-color: var(--color-primary);
    animation: focusGlow 0.4s ease-out;
}

.newsletter-submit-btn {
    display: block;
    margin: 1.5rem auto 0;
}

.newsletter-back-button {
    background: none;
    border: none;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.newsletter-back-button:hover {
    color: #333;
}

/* ===== Messages ===== */
.newsletter-privacy-notice {
    font-size: 0.75rem;
    color: #666;
    margin-top: 1.5rem;
    text-align: center;
}

.newsletter-message {
    margin: 1rem auto;
    padding: 1rem;
    border-radius: 4px;
    max-width: 500px;
    text-align: center;
}

.newsletter-message.success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid var(--color-success-border);
}

.newsletter-message.error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    border: 1px solid var(--color-error-border);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .lueckentext {
        font-size: 1.1rem;
    }
    .inline-field input {
        width: 6rem;
        padding: var(--space-1) var(--space-2);
    }
    .inline-field-wide input {
        width: 8rem;
    }
    .inline-field-email input {
        width: 10rem;
    }
}

/* === DARK MODE === */
[data-theme="dark"] .newsletter-back-button {
    color: var(--color-text-muted);
}
[data-theme="dark"] .newsletter-back-button:hover {
    color: var(--color-text-primary);
}
[data-theme="dark"] .newsletter-privacy-notice {
    color: var(--color-text-muted);
}
