/**
 * Frontend Form Styles - Optimiert für Erfolgsanzeige
 */

.lms-form-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: 100px; /* Verhindert das Zusammenspringen des Layouts */
}

.lms-form-wrapper {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem 2rem 2rem 2rem;
    position: relative;
}

/* Form Messages */
.lms-form-messages {
    margin-bottom: 1.5rem;
}

/* Erfolgsmeldung - Optimiert für Standalone-Anzeige */
.lms-form-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    padding: 20px;
    margin: 1rem 0;
    display: none; /* Wird per JS eingeblendet */
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.5;
}

.lms-form-success:before {
    content: "✓";
    font-weight: bold;
    margin-right: 12px;
    font-size: 1.5rem;
    color: #28a745;
}

.lms-form-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    padding: 12px 16px;
    margin-bottom: 1rem;
    display: none;
    align-items: center;
}

.lms-form-error:before {
    content: "⚠";
    margin-right: 8px;
    font-size: 1.2rem;
}

/* Form Layout */
.lms-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

.lms-form-group {
    margin-bottom: 1.5rem;
}

.lms-form-half {
    flex: 1;
    min-width: 0;
}

.lms-form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333333;
}

.lms-form-label .required {
    color: #dc3545;
    font-weight: bold;
}

.lms-form-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.lms-form-input:focus {
    outline: 0;
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.lms-form-input::placeholder {
    color: #999;
}

/* Validation States */
.lms-form-input.valid {
    border-color: #28a745;
}

.lms-form-input.invalid {
    border-color: #dc3545;
}

/* Privacy Checkbox Styling */
.lms-privacy-group {
    margin-top: 1.5rem;
}

.lms-privacy-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.5;
}

.lms-privacy-checkbox {
    margin-right: 10px;
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.lms-privacy-text {
    color: #555;
}

.lms-privacy-text a {
    color: #161F0F;
    text-decoration: underline;
}

.lms-privacy-text a:hover {
    color: #2c3e1d;
}

/* Form Actions */
.lms-form-actions {
    margin-top: 2rem;
    text-align: center;
}

.lms-form-submit {
    background-color: #161F0F;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0.875rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 300px;
}

.lms-form-submit:hover:not(:disabled) {
    background-color: #2c3e1d;
    transform: translateY(-1px);
}

.lms-form-submit:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Loading Spinner */
.lms-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: lms-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes lms-spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .lms-form-wrapper {
        padding: 1.25rem;
    }
    
    .lms-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .lms-form-submit {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .lms-form-container {
        padding: 0 0.5rem;
    }
    
    .lms-form-wrapper {
        padding: 1rem;
    }
    
    .lms-form-success {
        font-size: 1rem;
        padding: 15px;
    }
}