/**
 * GS Contact Forms - Frontend Styles
 */

.gscf-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);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.gscf-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;
}

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

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

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

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

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

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

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

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

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

.gscf-radio {
    width: auto;
}

/* Radio field: the field label on its own line, the choice buttons below it.
   The width setting (25/50/75/100) drives the width of each button. */
.gscf-field.gscf-field-radio {
    flex-wrap: wrap;
    flex-direction: row;
    row-gap: 8px;
}
.gscf-radio-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    row-gap: 8px;
    width: 100%;
}
.gscf-radio-row > .gscf-radio-label-text {
    flex: 0 0 auto;
    margin-bottom: 0;
    line-height: 1.3;
}
.gscf-radio-options {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: flex-start;
    column-gap: 8px;
    row-gap: 8px;
    width: 100%;
    min-width: 0;
}
.gscf-field.gscf-field-radio > .gscf-radio-row > .gscf-radio-options > .gscf-radio-label {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}
.gscf-field.gscf-field-radio.gscf-width-25 .gscf-radio-options > .gscf-radio-label { flex-basis: calc(25% - 6px); }
.gscf-field.gscf-field-radio.gscf-width-50 .gscf-radio-options > .gscf-radio-label { flex-basis: calc(50% - 4px); }
.gscf-field.gscf-field-radio.gscf-width-75 .gscf-radio-options > .gscf-radio-label { flex-basis: calc(75% - 2px); }
.gscf-field.gscf-field-radio.gscf-width-100 .gscf-radio-options > .gscf-radio-label { flex-basis: 100%; }

/* For radio fields the width setting controls each button, not the field box,
   so the generic field-width rules above must not shrink the radio container. */
.gscf-field.gscf-field-radio.gscf-width-25,
.gscf-field.gscf-field-radio.gscf-width-50,
.gscf-field.gscf-field-radio.gscf-width-75,
.gscf-field.gscf-field-radio.gscf-width-100 {
    width: 100%;
}

/* Section subform radios: same behaviour inside .gscf-section-fields */
.gscf-section-fields > .gscf-field.gscf-field-radio { flex-wrap: nowrap; }

/* ============================================================
   Radio options styled as buttons (same look as the checkbox
   buttons), so all choice fields feel identical. Works on every
   form thanks to the .gscf-form-wrapper scope.
   ============================================================ */
.gscf-form-wrapper .gscf-field-radio .gscf-radio {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
}

.gscf-form-wrapper .gscf-field-radio .gscf-radio-label {
    position: relative;
    display: flex;
    align-items: center;
    width: auto;
    min-height: 60px;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 16px;
    background: #ffffff;
    border: 2px solid #d5dae2;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: #3b4252;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
    -webkit-user-select: none;
    user-select: none;
}

.gscf-form-wrapper .gscf-field-radio .gscf-radio-label:hover {
    border-color: #fd5958;
    background: #fff8f7;
}

/* round indicator (before) + tick (after), aligned with the label text */
.gscf-form-wrapper .gscf-field-radio .gscf-radio-label::before {
    content: "";
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    box-sizing: border-box;
    background: #ffffff;
    border: 2px solid #c3cad6;
    border-radius: 50%;
    transition: background-color .15s ease, border-color .15s ease;
}

.gscf-form-wrapper .gscf-field-radio .gscf-radio-label::after {
    content: "";
    position: absolute;
    left: 23px;
    top: 50%;
    width: 15px;
    height: 15px;
    margin-top: -7px;
    z-index: 1;
    background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmZmZmIiBzdHJva2Utd2lkdGg9IjMuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNC41IDEyLjUgTDkuNSAxNy41IEwxOS41IDYuNSIvPjwvc3ZnPg==") no-repeat center / 100% 100%;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .15s ease, transform .15s ease;
    pointer-events: none;
}

.gscf-form-wrapper .gscf-field-radio .gscf-radio-label:has(.gscf-radio:checked) {
    background: #fff1f0;
    border-color: #fd5958;
    color: #d23a39;
    box-shadow: 0 0 0 3px rgba(253, 89, 88, 0.18);
}

.gscf-form-wrapper .gscf-field-radio .gscf-radio-label:has(.gscf-radio:checked)::before {
    background-color: #fd5958;
    border-color: #fd5958;
}

.gscf-form-wrapper .gscf-field-radio .gscf-radio-label:has(.gscf-radio:checked)::after {
    opacity: 1;
    transform: scale(1);
}

.gscf-form-wrapper .gscf-field-radio .gscf-radio-label:has(.gscf-radio:focus-visible) {
    border-color: #fd5958;
    box-shadow: 0 0 0 3px rgba(253, 89, 88, 0.38);
}

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

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

.gscf-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;
}

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

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

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

.gscf-custom-select-trigger .gscf-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;
}

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

.gscf-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) */
.gscf-dropdown-portal {
    animation: gscf-dropdown-open 0.2s ease-out;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.gscf-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%;
}

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

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

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

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

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

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

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

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

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

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

.gscf-vies-indicator.gscf-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;
}

.gscf-vies-indicator.gscf-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 gscf-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Small heading variant ("Μικρός τίτλος") */
/* Collapse the container's 20px row-gap above it down to ~7px.
   Only when it actually follows another field (so the first one is untouched). */
.gscf-field ~ .gscf-field.gscf-heading-small,
.gscf-section-wrapper ~ .gscf-field.gscf-heading-small {
    margin-top: -13px;
}

.gscf-field.gscf-heading-small .gscf-field-heading {
    font-size: 15px;
    margin: 0 5px;
}

/* Subform headings: drop the separator line + big margins in small mode */
.gscf-field.gscf-heading-small .gscf-heading-wrapper {
    margin: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.gscf-field.gscf-heading-small .gscf-heading-description {
    margin: 0 5px;
}

/* Section/Subform */
.gscf-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;
}

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

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

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

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

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

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

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

    /* Radio on small screens: buttons are twice as wide as on desktop */
    .gscf-field.gscf-field-radio.gscf-width-25 .gscf-radio-options > .gscf-radio-label { flex-basis: calc(50% - 4px) !important; }
    .gscf-field.gscf-field-radio.gscf-width-50 .gscf-radio-options > .gscf-radio-label,
    .gscf-field.gscf-field-radio.gscf-width-75 .gscf-radio-options > .gscf-radio-label,
    .gscf-field.gscf-field-radio.gscf-width-100 .gscf-radio-options > .gscf-radio-label { flex-basis: 100% !important; }
}

/* ALTCHA anti-spam: honeypot decoy field (hidden from humans) */
.gscf-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;
}

/* ============================================================
   Horizontal slider field
   Accent is overridable per form via:
   --gscf-slider-color / --gscf-slider-track
   ============================================================ */
.gscf-slider {
    --gscf-slider-color: #fd5958;
    --gscf-slider-track: #e4e7ee;
    --gscf-slider-pct: 0%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
    padding: 4px 2px 0;
}

.gscf-slider-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: baseline;
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--gscf-slider-color);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: .2px;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(253, 89, 88, .28);
    transition: background-color .15s ease;
}

.gscf-slider-prefix,
.gscf-slider-suffix {
    font-size: 1em;
    font-weight: inherit;
    opacity: 1;
}

.gscf-slider-input {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    height: 26px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    outline: none;
}

/* WebKit / Blink */
.gscf-slider-input::-webkit-slider-runnable-track {
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        var(--gscf-slider-color) 0,
        var(--gscf-slider-color) var(--gscf-slider-pct),
        var(--gscf-slider-track) var(--gscf-slider-pct),
        var(--gscf-slider-track) 100%
    ) !important;
}
.gscf-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 26px;
    height: 26px;
    margin-top: -8px;
    border-radius: 50%;
    background: #fff !important;
    border: 3px solid var(--gscf-slider-color) !important;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .28) !important;
    transition: transform .12s ease, box-shadow .12s ease;
}
.gscf-slider-input:hover::-webkit-slider-thumb,
.gscf-slider-input:focus-visible::-webkit-slider-thumb {
    transform: scale(1.12);
    box-shadow: 0 0 0 6px rgba(253, 89, 88, .18), 0 2px 6px rgba(16, 24, 40, .28) !important;
}

/* Firefox */
.gscf-slider-input::-moz-range-track {
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: var(--gscf-slider-track) !important;
}
.gscf-slider-input::-moz-range-progress {
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: var(--gscf-slider-color) !important;
}
.gscf-slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff !important;
    border: 3px solid var(--gscf-slider-color) !important;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .28) !important;
    transition: transform .12s ease, box-shadow .12s ease;
}
.gscf-slider-input:hover::-moz-range-thumb,
.gscf-slider-input:focus-visible::-moz-range-thumb {
    transform: scale(1.12);
    box-shadow: 0 0 0 6px rgba(253, 89, 88, .18), 0 2px 6px rgba(16, 24, 40, .28) !important;
}

.gscf-slider-scale {
    display: flex;
    justify-content: space-between;
    margin-top: -6px;
    font-size: 12px;
    font-weight: 600;
    color: #8a93a3;
}

@media (max-width: 480px) {
    .gscf-slider-badge {
        font-size: 17px;
        padding: 7px 14px;
    }
}
