/**
 * SocialMe Contact Sales Form - Frontend Styles
 */

.smcsf-form-wrapper {
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0px 20px rgba(0, 0, 0, 0.5);
}

.smcsf-form {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 20px;
    column-gap: 20px;
}

.smcsf-form .smcsf-hp-field,
.smcsf-form .smcsf-captcha,
.smcsf-form .smcsf-otp-section,
.smcsf-form .smcsf-message,
.smcsf-form .smcsf-submit-wrapper,
.smcsf-form .smcsf-section-wrapper {
    width: 100%;
}

.smcsf-field {
    display: flex;
    flex-direction: column;
}

.smcsf-width-25 {
    width: calc(25% - 15px);
}

.smcsf-width-50 {
    width: calc(50% - 10px);
}

.smcsf-width-75 {
    width: calc(75% - 5px);
}

.smcsf-width-100 {
    width: 100%;
}

.smcsf-field.smcsf-conditional-field,
.smcsf-section-wrapper.smcsf-conditional-field {
    display: none;
    overflow: hidden;
}

.smcsf-field.smcsf-conditional-field.visible,
.smcsf-section-wrapper.smcsf-conditional-field.visible {
    display: block;
    animation: smcsf-slide-down 0.4s ease-out forwards;
}

.smcsf-field.smcsf-conditional-field.hidden,
.smcsf-section-wrapper.smcsf-conditional-field.hidden {
    display: block;
    animation: smcsf-slide-up 0.3s ease-in forwards;
}

@keyframes smcsf-slide-down {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        max-height: 2000px;
        transform: translateY(0);
    }
}

@keyframes smcsf-slide-up {
    from {
        opacity: 1;
        max-height: 2000px;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        max-height: 0;
        transform: translateY(-20px);
    }
}

.smcsf-label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.smcsf-required {
    color: #d63638;
    margin-left: 3px;
}

.smcsf-input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.smcsf-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

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

.smcsf-checkbox-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.5;
    max-width: 100%;
}

.smcsf-checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    flex-shrink: 0;
}

.smcsf-checkbox-label-text {
    flex: 1;
    word-wrap: break-word;
    word-break: normal;
}

.smcsf-checkbox-label a {
    color: #0073aa;
    text-decoration: underline;
    font-weight: 500;
    word-break: break-word;
}

.smcsf-checkbox-label a:hover {
    color: #005a87;
    text-decoration: none;
}

.smcsf-checkbox {
    width: auto;
    margin: 0;
}

.smcsf-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.smcsf-radio {
    width: auto;
    margin: 0;
}

/* Custom Select Dropdown */
.smcsf-select {
    display: none; /* Hide native select */
}

.smcsf-custom-select {
    position: relative;
    width: 100%;
}

.smcsf-custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    min-height: 20px;
}

.smcsf-custom-select-trigger:hover {
    border-color: #0073aa;
}

.smcsf-custom-select.open .smcsf-custom-select-trigger {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
    border-radius: 4px 4px 0 0;
}

.smcsf-custom-select-trigger .smcsf-select-placeholder {
    color: #999;
}

.smcsf-custom-select-trigger .smcsf-select-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    transition: transform 0.2s ease;
    margin-left: 10px;
    flex-shrink: 0;
}

.smcsf-custom-select.open .smcsf-select-arrow {
    transform: rotate(180deg);
}

.smcsf-custom-select-options {
    position: absolute;
    background: #fff;
    border: 1px solid #0073aa;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 99999;
    display: none;
    box-sizing: border-box;
}

/* Portal dropdown (appended to body) */
.smcsf-dropdown-portal {
    animation: smcsf-dropdown-open 0.2s ease-out;
}

@keyframes smcsf-dropdown-open {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smcsf-custom-select-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.smcsf-custom-select-option:last-child {
    border-bottom: none;
}

.smcsf-custom-select-option:hover {
    background: #f5f9fc;
    color: #0073aa;
}

.smcsf-custom-select-option.selected {
    background: #0073aa;
    color: #fff;
}

.smcsf-custom-select-option.selected:hover {
    background: #005a87;
    color: #fff;
}

.smcsf-custom-select-option.disabled {
    color: #999;
    cursor: default;
    background: #f9f9f9;
}

.smcsf-custom-select-option.disabled:hover {
    background: #f9f9f9;
    color: #999;
}

.smcsf-custom-select-option.focused {
    background: #f5f9fc;
    color: #0073aa;
}

/* Custom scrollbar for dropdown */
.smcsf-custom-select-options::-webkit-scrollbar {
    width: 6px;
}

.smcsf-custom-select-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.smcsf-custom-select-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.smcsf-custom-select-options::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.smcsf-submit-wrapper {
    margin-top: 10px;
}

.smcsf-submit {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
}

.smcsf-submit:hover {
    background: #005a87;
}

.smcsf-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.smcsf-message {
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
}

.smcsf-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.smcsf-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Field specific styles */
.smcsf-field-text input,
.smcsf-field-email input,
.smcsf-field-number input,
.smcsf-field-tel input,
.smcsf-field-url input,
.smcsf-field-date input {
    width: 100%;
}

/* AFM field with VIES indicator */
.smcsf-afm-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.smcsf-afm-wrapper .smcsf-field-afm {
    flex: 1;
    padding-right: 40px;
}

.smcsf-vies-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
}

.smcsf-vies-indicator.smcsf-vies-loading {
    display: block;
    background: transparent;
    border: 2px solid #0073aa;
    border-top-color: transparent;
    animation: smcsf-spin 1s linear infinite;
}

.smcsf-vies-indicator.smcsf-vies-success {
    display: block;
    background: #28a745;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.smcsf-vies-indicator.smcsf-vies-error {
    display: block;
    background: #dc3545;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

@keyframes smcsf-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.smcsf-company-wrapper {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-left: 3px solid #0073aa;
    border-radius: 4px;
}

.smcsf-company-wrapper .smcsf-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.smcsf-company-note {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    background: #e0e0e0;
    padding: 2px 8px;
    border-radius: 3px;
}

.smcsf-company-wrapper .smcsf-field-company {
    background-color: #fff;
    border-color: #0073aa;
    cursor: not-allowed;
    font-weight: 500;
}

.smcsf-company-wrapper.smcsf-company-manual .smcsf-field-company {
    background-color: #fff;
    border-color: #ddd;
    cursor: text;
}

.smcsf-vies-failed-notice {
    font-size: 12px;
    color: #f0a51e;
    margin-top: 5px;
    font-style: italic;
}

/* OTP Section */
.smcsf-otp-section {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.smcsf-otp-send {
    margin-bottom: 15px;
}

.smcsf-otp-send .button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.smcsf-otp-send .button:hover {
    background: #005a87;
}

.smcsf-otp-verification {
    display: none;
    animation: smcsf-fade-in 0.3s ease-in;
}

.smcsf-otp-verification .smcsf-otp-input {
    width: 150px;
    text-align: center;
    font-size: 18px;
    letter-spacing: 5px;
    margin-right: 10px;
}

.smcsf-verify-otp-btn {
    background: #28a745 !important;
    color: #fff !important;
}

.smcsf-verify-otp-btn:hover {
    background: #218838 !important;
}

@keyframes smcsf-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Heading/Title Field */
.smcsf-heading-wrapper {
    margin: 25px 0 15px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
}

.smcsf-heading-wrapper:first-child {
    margin-top: 0;
}

.smcsf-field-heading {
    font-size: 20px;
    font-weight: 600;
    color: #0073aa;
    margin: 0px;
}

.smcsf-heading-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    font-style: italic;
}

/* Section/Subform */
.smcsf-section-wrapper {
    margin: 30px 0;
    padding: 20px;
    padding-left: 25px;
    background: #fafafa;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.4s ease-out;
}

.smcsf-section-wrapper.smcsf-conditional-field {
    overflow: hidden;
}

.smcsf-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #0073aa;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.smcsf-section-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
    font-style: italic;
}

.smcsf-section-fields {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 20px;
    column-gap: 20px;
}

.smcsf-section-fields > .smcsf-field {
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .smcsf-form-wrapper {
        padding: 20px;
    }

    .smcsf-width-25,
    .smcsf-width-50,
    .smcsf-width-75 {
        width: 100%;
    }
}

/* ALTCHA anti-spam: honeypot decoy field (hidden from humans) */
.smcsf-hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
