/**
 * HNMC Kontaktformular - Frontend Styles
 * Modern Google Forms inspired design
 * 
 * @package HNMC_Kontaktformular
 */

/* CSS Custom Properties */
:root {
    --hnmc-primary: #1a73e8;
    --hnmc-primary-dark: #1557b0;
    --hnmc-primary-light: #e8f0fe;
    --hnmc-text: #202124;
    --hnmc-text-secondary: #5f6368;
    --hnmc-border: #dadce0;
    --hnmc-border-focus: #1a73e8;
    --hnmc-background: #ffffff;
    --hnmc-background-secondary: #f8f9fa;
    --hnmc-error: #d93025;
    --hnmc-error-bg: #fce8e6;
    --hnmc-success: #1e8e3e;
    --hnmc-success-bg: #e6f4ea;
    --hnmc-radius: 8px;
    --hnmc-radius-small: 4px;
    --hnmc-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
    --hnmc-shadow-hover: 0 4px 12px rgba(60, 64, 67, 0.2);
    --hnmc-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form Wrapper */
.hnmc-contact-form-wrapper {
    font-family: 'Google Sans', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

/* Form Container */
.hnmc-contact-form {
    background: var(--hnmc-background);
    border-radius: var(--hnmc-radius);
    box-shadow: var(--hnmc-shadow);
    padding: 32px;
}

/* Form Fields Container */
.hnmc-form-fields {
    display: grid;
    gap: 24px;
}

/* Column Layouts */
.hnmc-columns-1 .hnmc-form-fields {
    grid-template-columns: 1fr;
}

.hnmc-columns-2 .hnmc-form-fields {
    grid-template-columns: repeat(2, 1fr);
}

.hnmc-columns-2 .hnmc-field-full {
    grid-column: 1 / -1;
}

/* Form Group */
.hnmc-form-group {
    position: relative;
}

/* Labels */
.hnmc-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--hnmc-text);
    margin-bottom: 8px;
    line-height: 1.4;
}

.hnmc-required {
    color: var(--hnmc-error);
    margin-left: 2px;
}

/* Input Fields - Modern Style */
.hnmc-style-modern .hnmc-input,
.hnmc-style-modern .hnmc-textarea,
.hnmc-style-modern .hnmc-select {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--hnmc-text);
    background-color: var(--hnmc-background);
    border: 1px solid var(--hnmc-border);
    border-radius: var(--hnmc-radius-small);
    transition: all var(--hnmc-transition);
    box-sizing: border-box;
}

.hnmc-style-modern .hnmc-input:hover,
.hnmc-style-modern .hnmc-textarea:hover,
.hnmc-style-modern .hnmc-select:hover {
    border-color: var(--hnmc-text-secondary);
}

.hnmc-style-modern .hnmc-input:focus,
.hnmc-style-modern .hnmc-textarea:focus,
.hnmc-style-modern .hnmc-select:focus {
    outline: none;
    border-color: var(--hnmc-primary);
    box-shadow: 0 0 0 2px var(--hnmc-primary-light);
}

/* Textarea */
.hnmc-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Select */
.hnmc-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Checkbox Styles */
.hnmc-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
}

.hnmc-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.hnmc-checkbox-custom {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--hnmc-border);
    border-radius: var(--hnmc-radius-small);
    background: var(--hnmc-background);
    transition: all var(--hnmc-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hnmc-checkbox:checked + .hnmc-checkbox-custom {
    background: var(--hnmc-primary);
    border-color: var(--hnmc-primary);
}

.hnmc-checkbox:checked + .hnmc-checkbox-custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.hnmc-checkbox:focus + .hnmc-checkbox-custom {
    box-shadow: 0 0 0 2px var(--hnmc-primary-light);
}

.hnmc-checkbox-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--hnmc-text);
}

/* Radio Styles */
.hnmc-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hnmc-radio-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 4px 0;
}

.hnmc-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.hnmc-radio-custom {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--hnmc-border);
    border-radius: 50%;
    background: var(--hnmc-background);
    transition: all var(--hnmc-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hnmc-radio:checked + .hnmc-radio-custom {
    border-color: var(--hnmc-primary);
}

.hnmc-radio:checked + .hnmc-radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--hnmc-primary);
    border-radius: 50%;
}

.hnmc-radio:focus + .hnmc-radio-custom {
    box-shadow: 0 0 0 2px var(--hnmc-primary-light);
}

.hnmc-radio-text {
    font-size: 14px;
    color: var(--hnmc-text);
}

/* reCAPTCHA Container */
.hnmc-recaptcha-container {
    padding: 16px 0;
}

/* Submit Button */
.hnmc-submit-container {
    padding-top: 8px;
}

.hnmc-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 500;
    color: white;
    background: var(--hnmc-primary);
    border: none;
    border-radius: var(--hnmc-radius-small);
    cursor: pointer;
    transition: all var(--hnmc-transition);
    text-transform: none;
    letter-spacing: 0.25px;
}

.hnmc-submit-button:hover {
    background: var(--hnmc-primary-dark);
    box-shadow: var(--hnmc-shadow-hover);
}

.hnmc-submit-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--hnmc-primary-light);
}

.hnmc-submit-button:disabled {
    background: var(--hnmc-border);
    cursor: not-allowed;
    box-shadow: none;
}

/* Loading State */
.hnmc-button-loading {
    display: flex;
    align-items: center;
}

.hnmc-spinner {
    width: 20px;
    height: 20px;
    animation: hnmc-spin 1s linear infinite;
}

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

/* Field Error */
.hnmc-field-error {
    font-size: 12px;
    color: var(--hnmc-error);
    margin-top: 6px;
    min-height: 18px;
}

.hnmc-form-group.has-error .hnmc-input,
.hnmc-form-group.has-error .hnmc-textarea,
.hnmc-form-group.has-error .hnmc-select {
    border-color: var(--hnmc-error);
}

/* Form Messages */
.hnmc-form-messages {
    margin-top: 24px;
    padding: 16px 20px;
    border-radius: var(--hnmc-radius-small);
    font-size: 14px;
    line-height: 1.5;
    display: none;
}

.hnmc-form-messages.success {
    display: block;
    background: var(--hnmc-success-bg);
    color: var(--hnmc-success);
    border: 1px solid #34a853;
}

.hnmc-form-messages.error {
    display: block;
    background: var(--hnmc-error-bg);
    color: var(--hnmc-error);
    border: 1px solid #ea4335;
}

/* =========================
   STYLE VARIATIONS
   ========================= */

/* Classic Style */
.hnmc-style-classic .hnmc-contact-form {
    box-shadow: none;
    border: 1px solid var(--hnmc-border);
}

.hnmc-style-classic .hnmc-input,
.hnmc-style-classic .hnmc-textarea,
.hnmc-style-classic .hnmc-select {
    border-radius: 0;
    padding: 12px;
}

.hnmc-style-classic .hnmc-submit-button {
    border-radius: 0;
}

/* Minimal Style */
.hnmc-style-minimal .hnmc-contact-form {
    box-shadow: none;
    padding: 24px 0;
    background: transparent;
}

.hnmc-style-minimal .hnmc-input,
.hnmc-style-minimal .hnmc-textarea,
.hnmc-style-minimal .hnmc-select {
    border: none;
    border-bottom: 2px solid var(--hnmc-border);
    border-radius: 0;
    padding: 12px 0;
    background: transparent;
}

.hnmc-style-minimal .hnmc-input:focus,
.hnmc-style-minimal .hnmc-textarea:focus,
.hnmc-style-minimal .hnmc-select:focus {
    box-shadow: none;
    border-bottom-color: var(--hnmc-primary);
}

.hnmc-style-minimal .hnmc-submit-button {
    background: transparent;
    color: var(--hnmc-primary);
    border: 2px solid var(--hnmc-primary);
}

.hnmc-style-minimal .hnmc-submit-button:hover {
    background: var(--hnmc-primary);
    color: white;
}

/* Rounded Style */
.hnmc-style-rounded .hnmc-contact-form {
    border-radius: 24px;
    padding: 40px;
}

.hnmc-style-rounded .hnmc-input,
.hnmc-style-rounded .hnmc-textarea,
.hnmc-style-rounded .hnmc-select {
    border-radius: 24px;
    padding: 16px 24px;
}

.hnmc-style-rounded .hnmc-submit-button {
    border-radius: 24px;
    padding: 14px 40px;
}

.hnmc-style-rounded .hnmc-checkbox-custom {
    border-radius: 6px;
}

/* =========================
   RESPONSIVE DESIGN
   ========================= */

@media (max-width: 768px) {
    .hnmc-contact-form-wrapper {
        padding: 16px;
    }
    
    .hnmc-contact-form {
        padding: 24px;
    }
    
    .hnmc-columns-2 .hnmc-form-fields {
        grid-template-columns: 1fr;
    }
    
    .hnmc-columns-2 .hnmc-field-half {
        grid-column: auto;
    }
    
    .hnmc-submit-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hnmc-contact-form {
        padding: 20px;
    }
    
    .hnmc-input,
    .hnmc-textarea,
    .hnmc-select {
        padding: 14px;
        font-size: 16px;
    }
}

/* =========================
   ACCESSIBILITY
   ========================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .hnmc-input,
    .hnmc-textarea,
    .hnmc-select {
        border-width: 2px;
    }
    
    .hnmc-submit-button {
        border: 2px solid currentColor;
    }
}

/* Notice for Block Editor */
.hnmc-notice {
    padding: 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--hnmc-radius-small);
    color: #856404;
    font-size: 14px;
}
