/**
 * M-Drei Lizenzformular CSS
 * Responsives Design für das Formular-Widget
 */

/* Formular-Container */
.m3-lizenz-form-container {
    max-width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    margin-bottom: 20px;
}

/* Formular-Überschrift */
.m3-lizenz-form-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 600;
}

/* Formular-Beschreibung */
.m3-lizenz-form-description {
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Formular-Zeilen */
.m3-lizenz-form-row {
    margin-bottom: 15px;
}

/* Formular-Gruppen */
.m3-lizenz-form-group {
    position: relative;
}

/* Formular-Labels */
.m3-lizenz-form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

/* Pflichtfeld-Markierung */
.m3-lizenz-form-label .required {
    color: #e32;
    margin-left: 3px;
}

/* Formular-Input-Felder */
.m3-lizenz-form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.m3-lizenz-form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Checkbox-Styling */
.m3-lizenz-form-checkbox {
    display: flex;
    align-items: flex-start;
}

.m3-lizenz-form-checkbox input[type="checkbox"] {
    margin-top: 3px;
    margin-right: 8px;
}

.m3-lizenz-form-checkbox-label {
    font-weight: normal;
    line-height: 1.4;
    color: inherit;
    font-size: inherit;
}

/* Links in Checkbox-Labels */
.m3-lizenz-form-checkbox-label a {
    color: white;
    font-weight: bold;
    text-decoration: underline;
}

/* Submit-Button */
.m3-lizenz-form-submit {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 10px 20px;
    font-size: 16px;
    line-height: 1.5;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.15s ease-in-out, 
                background-color 0.15s ease-in-out,
                border-color 0.15s ease-in-out, 
                box-shadow 0.15s ease-in-out;
}

.m3-lizenz-form-submit:hover {
    opacity: 0.9;
}

.m3-lizenz-form-submit:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.m3-lizenz-form-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Lade-Animation */
.m3-lizenz-form-loader {
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #666;
    animation: m3-lizenz-spin 1s linear infinite;
}

@keyframes m3-lizenz-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fehlermeldungen */
.m3-lizenz-form-error {
    color: #e32;
    font-size: 0.9em;
    margin-top: 5px;
    display: block;
}

.m3-lizenz-form-error-field {
    border-color: #e32 !important;
    box-shadow: 0 0 2px 1px rgba(227, 50, 50, 0.2) !important;
}

.m3-lizenz-form-control:focus.m3-lizenz-form-error-field {
    border-color: #e32 !important;
    outline: none;
    box-shadow: 0 0 4px 1px rgba(227, 50, 50, 0.3) !important;
}

.m3-lizenz-form-messages {
    margin-bottom: 20px;
    padding: 10px 15px;
    border-radius: 4px;
    transition: all 0.3s ease-in-out;
}

.m3-lizenz-form-messages.m3-lizenz-form-error {
    background-color: #fff6f6;
    border: 1px solid #fad6d6;
    color: #9f3a38;
}

.m3-lizenz-form-messages.m3-lizenz-form-success {
    background-color: #f8fffa;
    border: 1px solid #d4edda;
    color: #155724;
    /* Verbesserte Erfolgsanzeige */
    animation: success-message-highlight 0.5s ease-in-out;
    padding: 20px;
    font-size: 18px;
    text-align: center;
    margin: 30px auto;
    max-width: 90%;
    box-shadow: 0 2px 10px rgba(0, 128, 0, 0.1);
    border-radius: 6px;
}

/* Animation für die Erfolgsmeldung */
@keyframes success-message-highlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0, 128, 0, 0);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 10px rgba(0, 128, 0, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 5px rgba(0, 128, 0, 0.2);
    }
}

/* Fokussierte Erfolgsmeldung (wenn Formular ausgeblendet ist) */
.m3-lizenz-form-messages.m3-lizenz-form-success-focused {
    background-color: #f0fff0;
    border: 1px solid #b8e6b8;
    color: #145214;
    padding: 20px;
    font-size: 18px;
    text-align: center;
    margin: 30px auto;
    max-width: 80%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Honeypot-Feld (für Spam-Schutz) verstecken */
.m3-lizenz-honeypot-field {
    display: none;
    position: absolute;
    left: -9999px;
}

/* reCAPTCHA-Container */
.g-recaptcha {
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 767px) {
    .m3-lizenz-form-title {
        font-size: 20px;
    }
    
    .m3-lizenz-form-submit {
        width: 100%;
    }
    
    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: 0 0;
    }
}

@media (max-width: 480px) {
    .m3-lizenz-form-container {
        padding: 15px;
    }
    
    .m3-lizenz-form-control {
        font-size: 14px;
    }
    
    .m3-lizenz-form-submit {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .g-recaptcha {
        transform: scale(0.75);
        transform-origin: 0 0;
    }
}

/* Formular-Container mit Schatten */
.m3-lizenz-form-container.with-shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Responsive Styles für das M-Drei Lizenzformular */

/* Zwei-Spalten-Layout für Vor- und Nachname */
.m3-lizenz-form-row-two-column {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

.m3-lizenz-form-row-two-column .m3-lizenz-form-group {
    flex: 1;
    min-width: 45%;
}

/* Mobile Ansicht für Bildschirme unter 768px */
@media screen and (max-width: 767px) {
    .m3-lizenz-form-row-two-column {
        flex-direction: column;
        gap: 10px;
    }
    
    .m3-lizenz-form-row-two-column .m3-lizenz-form-group {
        width: 100%;
    }
} 