/**
 * eCOUNT Contact Form - Frontend Styles
 * 
 * @package eCOUNT_Contact_Form
 * @since 1.0.0
 * @author datenlabor.io
 */

/* ========================================
   Base Styles
   ======================================== */

.ecount-full-form,
.ecount-callback-form {
    width: 100%;
    margin: 0 auto;
    padding: 40px;
    background: transparent;
    border-radius: 25px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

/* Form elements order */
.ecount-form-header {
    order: 1;
}

.ecount-form-steps {
    order: 2;
}

.ecount-step-indicators {
    order: 3;
}

.ecount-progress-bar {
    order: 4;
}

/* Form Header */
.ecount-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.ecount-form-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.ecount-form-subtitle {
    font-size: 18px;
    color: #6c757d;
    margin: 0;
}

/* Progress Bar */
.ecount-progress-bar {
    height: 2px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 1px;
    overflow: hidden;
    margin-top: 10px;
    margin-bottom: 0;
}

.ecount-progress-fill {
    height: 100%;
    background: rgba(0, 158, 227, 0.3);
    transition: width 0.3s ease;
}

/* Step Indicators */
.ecount-step-indicators {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    margin-bottom: 15px;
    gap: 15px;
}

.ecount-step-indicator {
    flex: 1;
    text-align: center;
    position: relative;
}

.ecount-step-indicator:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -7.5px;
    width: calc(100% - 40px);
    height: 2px;
    background: #e9ecef;
    z-index: -1;
}

.ecount-step-indicator.completed:not(:last-child)::after {
    background: #00C389;
}

.step-number {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.ecount-step-indicator.active .step-number {
    background: #009EE3;
    color: #ffffff;
}

.ecount-step-indicator.completed .step-number {
    background: #00C389;
    color: #ffffff;
}

.ecount-step-indicator.completed .step-number::after {
    content: '✓';
}

.step-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.ecount-step-indicator.active .step-label {
    color: #009EE3;
    font-weight: 600;
}

/* ========================================
   Form Steps Container
   ======================================== */

.ecount-form-steps {
    position: relative;
    min-height: 400px;
    margin-bottom: 0;
}

.ecount-form-step {
    display: none;
}

.ecount-form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 30px 0;
    text-align: center;
}

/* ========================================
   Inquiry Type Selection
   ======================================== */

.inquiry-types-grid,
.service-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.inquiry-option,
.service-type-option {
    padding: 20px 15px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inquiry-option:hover,
.service-type-option:hover {
    border-color: #009EE3;
    background: #ffffff;
}

.inquiry-option.selected,
.service-type-option.selected {
    border-color: #009EE3;
    background: rgba(0, 158, 227, 0.05);
}

.inquiry-icon,
.service-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.9;
}

.inquiry-icon svg,
.service-icon svg {
    transition: all 0.2s ease;
}

.inquiry-title,
.service-type-option h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px 0;
}

.inquiry-description,
.service-type-option p {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.inquiry-option.selected .inquiry-title,
.service-type-option.selected h4 {
    color: #009EE3;
}

/* ========================================
   Form Fields
   ======================================== */

.form-fields {
    margin-bottom: 30px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.form-field label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field input[type="datetime-local"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    font-size: 16px;
    color: #1a1a1a;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: #009EE3;
    outline: none;
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
}

.field-hint {
    display: block;
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
}

/* Checkbox Fields */
.form-field-checkbox {
    margin-top: 25px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 15px;
    color: #1a1a1a;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #009EE3;
}

.checkbox-label a {
    color: #009EE3;
    text-decoration: underline;
}

.checkbox-label a:hover {
    color: #007ab8;
}

/* ========================================
   Buttons
   ======================================== */

.ecount-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ecount-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #009EE3;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #007ab8;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    color: #ffffff;
}

.btn-success {
    background: #00C389;
    color: #ffffff;
    font-size: 18px;
    padding: 15px 40px;
}

.btn-success:hover:not(:disabled) {
    background: #00a876;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Button Loading Spinner */
.btn-loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Navigation Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.form-navigation .btn-next,
.form-navigation .btn-submit {
    margin-left: auto;
}

/* ========================================
   Summary Section
   ======================================== */

.form-summary {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 25px;
    margin-bottom: 25px;
}

.form-summary h4 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 20px 0;
}

.summary-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.summary-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.summary-section h5 {
    font-size: 16px;
    font-weight: 600;
    color: #009EE3;
    margin: 0 0 10px 0;
}

.summary-section p {
    font-size: 15px;
    color: #1a1a1a;
    margin: 5px 0;
    line-height: 1.6;
}

.summary-section p strong {
    color: #6c757d;
    font-weight: 600;
}

/* ========================================
   Success & Error Messages
   ======================================== */

.ecount-form-success,
.ecount-form-error {
    text-align: center;
    padding: 60px 40px;
    animation: fadeIn 0.3s ease;
}

.success-icon,
.error-icon {
    font-size: 72px;
    margin-bottom: 20px;
}

.ecount-form-success h3 {
    font-size: 28px;
    font-weight: 600;
    color: #00C389;
    margin: 0 0 15px 0;
}

.success-message {
    font-size: 18px;
    color: #6c757d;
    margin: 0;
    line-height: 1.6;
}

.error-message {
    font-size: 18px;
    color: #e74c3c;
    margin: 0 0 25px 0;
    line-height: 1.6;
}

.btn-retry {
    margin-top: 20px;
}

/* Validation Messages */
.ecount-validation-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    z-index: 9999;
}

.validation-error {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-left: 4px solid #ff9800;
    color: #856404;
    padding: 15px 20px;
    border-radius: 25px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .ecount-full-form,
    .ecount-callback-form {
        padding: 25px;
    }

    .ecount-form-title {
        font-size: 24px;
    }

    .ecount-form-subtitle {
        font-size: 16px;
    }

    .ecount-step-indicators {
        gap: 8px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .step-label {
        font-size: 11px;
    }

    .ecount-step-indicator:not(:last-child)::after {
        right: -4px;
        width: calc(100% - 32px);
    }

    .step-title {
        font-size: 20px;
    }

    .inquiry-types-grid,
    .service-types-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .inquiry-icon,
    .service-icon {
        font-size: 28px;
    }

    .inquiry-title,
    .service-type-option h4 {
        font-size: 15px;
    }

    .form-field input,
    .form-field textarea,
    .form-field select {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .form-navigation {
        flex-direction: column;
    }

    .form-navigation .btn-next,
    .form-navigation .btn-submit {
        margin-left: 0;
        width: 100%;
    }

    .ecount-btn {
        width: 100%;
        justify-content: center;
    }

    .ecount-validation-messages {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .form-summary {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .ecount-full-form,
    .ecount-callback-form {
        padding: 20px 15px;
    }

    .ecount-form-title {
        font-size: 22px;
    }

    .step-title {
        font-size: 18px;
    }

    .inquiry-option,
    .service-type-option {
        padding: 18px 15px;
    }

    .btn-success {
        font-size: 16px;
        padding: 12px 30px;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .ecount-progress-bar,
    .ecount-step-indicators,
    .form-navigation,
    .btn-retry {
        display: none !important;
    }

    .ecount-full-form,
    .ecount-callback-form {
        box-shadow: none;
        padding: 0;
    }

    .ecount-form-step {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* ========================================
   Accessibility
   ======================================== */

.ecount-btn:focus,
.form-field input:focus,
.form-field textarea:focus,
.checkbox-label input:focus {
    outline: 2px solid #009EE3;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .inquiry-option,
    .service-type-option {
        border-width: 3px;
    }

    .inquiry-option.selected,
    .service-type-option.selected {
        border-width: 4px;
    }
}

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