/**
 * Ascotech Custom Contact Form - Frontend Styles
 * Modern, responsive, accessible, theme-adaptable.
 */

:root {
    --asc-primary: #0f766e;
    --asc-primary-hover: #0d635c;
    --asc-primary-focus: rgba(15, 118, 110, 0.25);
    --asc-radius: 8px;
    --asc-bg-container: #ffffff;
    --asc-bg-input: #f8fafc;
    --asc-bg-input-focus: #ffffff;
    --asc-border: #e2e8f0;
    --asc-border-focus: #0f766e;
    --asc-text-main: #1e293b;
    --asc-text-label: #475569;
    --asc-text-muted: #64748b;
    --asc-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --asc-success-bg: #ecfdf5;
    --asc-success-border: #a7f3d0;
    --asc-success-text: #065f46;
    --asc-error-bg: #fef2f2;
    --asc-error-border: #fecaca;
    --asc-error-text: #991b1b;
}

/* Base Form Wrapper */
.ascotech-form-wrapper {
    box-sizing: border-box;
    width: 100%;
    margin: 1.5rem 0;
    font-family: inherit;
}

.ascotech-form-wrapper *,
.ascotech-form-wrapper *::before,
.ascotech-form-wrapper *::after {
    box-sizing: inherit;
}

/* Container Card */
.ascotech-form-container {
    background-color: var(--asc-bg-container);
    border: 1px solid var(--asc-border);
    border-radius: var(--asc-radius);
    padding: 2.25rem;
    box-shadow: var(--asc-shadow);
    transition: all 0.3s ease;
}

/* Header */
.ascotech-form-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--asc-border);
}

.ascotech-form-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--asc-text-main);
}

.ascotech-form-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--asc-text-muted);
}

/* Grid Layout */
.ascotech-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.25rem 1rem;
}

.ascotech-col-12 {
    grid-column: span 12;
}

.ascotech-col-6 {
    grid-column: span 6;
}

/* Field Groups */
.ascotech-field {
    display: flex;
    flex-direction: column;
}

.ascotech-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--asc-text-label);
    margin-bottom: 0.5rem;
}

/* Inputs & Textareas */
.ascotech-form input[type="text"],
.ascotech-form input[type="email"],
.ascotech-form input[type="tel"],
.ascotech-form textarea,
.ascotech-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--asc-text-main);
    background-color: var(--asc-bg-input);
    border: 1.5px solid var(--asc-border);
    border-radius: var(--asc-radius);
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.ascotech-form input::placeholder,
.ascotech-form textarea::placeholder {
    color: #94a3b8;
    opacity: 0.8;
}

.ascotech-form input:focus,
.ascotech-form textarea:focus,
.ascotech-form select:focus {
    background-color: var(--asc-bg-input-focus);
    border-color: var(--asc-primary);
    box-shadow: 0 0 0 3px var(--asc-primary-focus);
}

.ascotech-form input.asc-invalid,
.ascotech-form textarea.asc-invalid,
.ascotech-form select.asc-invalid {
    border-color: #ef4444 !important;
    background-color: #fff5f5;
}

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

/* Custom Select Dropdown */
.ascotech-select-wrapper {
    position: relative;
    width: 100%;
}

.ascotech-select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.5rem;
    cursor: pointer;
}

.ascotech-select-wrapper::after {
    content: "";
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background-color: var(--asc-text-muted);
    clip-path: polygon(100% 0%, 0 0%, 50% 100%);
    pointer-events: none;
    transition: transform 0.2s ease;
}

/* File Upload Field */
.ascotech-file-upload-field {
    margin-top: 0.5rem;
}

.ascotech-file-input-wrapper {
    position: relative;
    border: 2px dashed var(--asc-border);
    border-radius: var(--asc-radius);
    padding: 1.25rem;
    text-align: center;
    background-color: var(--asc-bg-input);
    transition: all 0.2s ease;
    cursor: pointer;
}

.ascotech-file-input-wrapper:hover {
    border-color: var(--asc-primary);
    background-color: #f1f5f9;
}

.ascotech-file-input-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.ascotech-file-custom-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--asc-text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

/* Consent / Checkbox Group */
.ascotech-consent-group {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ascotech-checkbox-container {
    display: flex;
    align-items: flex-start;
    position: relative;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.4;
    user-select: none;
    color: var(--asc-text-label);
}

.ascotech-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.ascotech-checkmark {
    position: relative;
    top: 2px;
    left: 0;
    height: 18px;
    width: 18px;
    min-width: 18px;
    background-color: var(--asc-bg-input);
    border: 1.5px solid var(--asc-border);
    border-radius: 4px;
    margin-right: 0.75rem;
    transition: all 0.2s ease;
}

.ascotech-checkbox-container:hover input ~ .ascotech-checkmark {
    border-color: var(--asc-primary);
}

.ascotech-checkbox-container input:checked ~ .ascotech-checkmark {
    background-color: var(--asc-primary);
    border-color: var(--asc-primary);
}

.ascotech-checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ascotech-checkbox-container input:checked ~ .ascotech-checkmark::after {
    display: block;
}

.ascotech-checkbox-label-text a {
    color: var(--asc-primary);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.ascotech-checkbox-label-text a:hover {
    opacity: 0.8;
}

/* Submit Button & Actions */
.ascotech-form-actions {
    margin-top: 1.75rem;
}

.ascotech-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    background-color: var(--asc-primary);
    border: none;
    border-radius: var(--asc-radius);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.ascotech-submit-btn:hover {
    background-color: var(--asc-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.ascotech-submit-btn:active {
    transform: translateY(0);
}

.ascotech-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Button Spinner */
.ascotech-btn-spinner {
    display: inline-flex;
    margin-left: 0.6rem;
}

.ascotech-spinner-svg {
    animation: asc-rotate 1.4s linear infinite;
    width: 20px;
    height: 20px;
}

.ascotech-spinner-svg .path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: asc-dash 1.4s ease-in-out infinite;
}

@keyframes asc-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes asc-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Feedback / Response Messages */
.ascotech-response-message {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: var(--asc-radius);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    animation: asc-fade-slide 0.3s ease-out forwards;
}

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

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

@keyframes asc-fade-slide {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* THEMES */

/* Dark Theme */
.ascotech-theme-dark {
    --asc-bg-container: #18181b;
    --asc-bg-input: #27272a;
    --asc-bg-input-focus: #3f3f46;
    --asc-border: #3f3f46;
    --asc-text-main: #f4f4f5;
    --asc-text-label: #a1a1aa;
    --asc-text-muted: #71717a;
    --asc-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

/* Glassmorphism Theme */
.ascotech-theme-glass {
    --asc-bg-container: rgba(255, 255, 255, 0.7);
    --asc-bg-input: rgba(255, 255, 255, 0.6);
    --asc-border: rgba(255, 255, 255, 0.4);
    --asc-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.12);
}

.ascotech-theme-glass .ascotech-form-container {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Minimalist Flat Theme */
.ascotech-theme-minimal {
    --asc-bg-container: transparent;
    --asc-shadow: none;
    --asc-border: #cbd5e1;
}

.ascotech-theme-minimal .ascotech-form-container {
    border: none;
    padding: 0;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .ascotech-col-6 {
        grid-column: span 12;
    }

    .ascotech-form-container {
        padding: 1.5rem 1rem;
    }

    .ascotech-form-title {
        font-size: 1.25rem;
    }
}
