/* fares.net contact form — drop-in module
   colors use currentColor + color-mix so the form inherits from the page */

.ff-mount {
    max-width: 560px;
    margin: 30px auto 0;
    padding: 0 20px;
    text-align: center;
    color-scheme: light dark;
}

.ff-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    background: none;
    color: #0056b3;
    border: 1px solid color-mix(in srgb, #0056b3 30%, transparent);
    padding: 11px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.ff-toggle .ff-icon-envelope {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.ff-toggle:hover {
    background-color: #0056b3;
    color: #fff;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.ff-toggle:hover .ff-icon-envelope {
    animation: ff-envelope-bounce 0.6s ease;
}

.ff-toggle.is-open .ff-icon-envelope {
    transform: rotate(-12deg) scale(0.95);
}

@keyframes ff-envelope-bounce {
    0%   { transform: translateY(0) rotate(0); }
    25%  { transform: translateY(-3px) rotate(-8deg); }
    50%  { transform: translateY(0) rotate(0); }
    75%  { transform: translateY(-2px) rotate(6deg); }
    100% { transform: translateY(0) rotate(0); }
}

.ff-form {
    margin-top: 18px;
    text-align: start;
    animation: ff-fade-in 0.35s ease-out;
    transform-origin: top center;
}

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

.ff-form.is-closing {
    animation: ff-fold-out 0.45s cubic-bezier(0.55, 0, 0.55, 1) forwards;
    pointer-events: none;
}

@keyframes ff-fold-out {
    0%   { opacity: 1; transform: translateY(0)    scale(1);    filter: blur(0); }
    50%  { opacity: 1; transform: translateY(-6px) scale(0.98); filter: blur(0); }
    100% { opacity: 0; transform: translateY(-24px) scale(0.94); filter: blur(2px); }
}

.ff-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 22px;
}

.ff-logo-link {
    flex-shrink: 0;
    display: inline-flex;
    line-height: 0;
    border-radius: 8px;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.6;
}

.ff-logo-link:hover {
    opacity: 1;
    transform: scale(1.08);
}

.ff-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.ff-group {
    background-color: color-mix(in srgb, currentColor 5%, transparent);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ff-group > input,
.ff-group > select,
.ff-group > textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    padding: 18px 20px;
    color: inherit;
    outline: none;
    border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
    transition: background-color 0.15s, box-shadow 0.2s;
}

.ff-group > *:last-child { border-bottom: 0; }

.ff-group > *:focus {
    background-color: color-mix(in srgb, currentColor 5%, transparent);
}

.ff-group input::placeholder,
.ff-group textarea::placeholder {
    color: inherit;
    opacity: 0.45;
}

/* Email field is always LTR regardless of page direction */
.ff-group .ff-email {
    direction: ltr;
    text-align: start;
    unicode-bidi: plaintext;
}

.ff-group .ff-invalid {
    background-color: color-mix(in srgb, #d92d20 10%, transparent);
    box-shadow: inset 3px 0 0 #d92d20;
    animation: ff-shake 0.35s ease;
}

[dir="ltr"] .ff-group .ff-invalid {
    box-shadow: inset -3px 0 0 #d92d20;
}

@keyframes ff-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.ff-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

.ff-group select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='currentColor' fill-opacity='0.5' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: left 20px center;
    padding-left: 44px;
}

[dir="ltr"] .ff-group select {
    background-position: right 20px center;
    padding-left: 20px;
    padding-right: 44px;
}

.ff-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 180px;
    font-family: inherit;
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    color: #fff;
    border: 0;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    margin: 0;
    box-shadow: 0 8px 20px rgba(0, 86, 179, 0.28);
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    overflow: hidden;
    position: relative;
}

.ff-submit .ff-icon-plane {
    width: 18px;
    height: 18px;
    transition: transform 0.4s ease;
}

.ff-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(0, 86, 179, 0.4);
}

.ff-submit:hover:not(:disabled) .ff-icon-plane {
    transform: translateX(4px) rotate(-8deg);
}

[dir="rtl"] .ff-submit:hover:not(:disabled) .ff-icon-plane {
    transform: translateX(-4px) rotate(8deg) scaleX(-1);
}

[dir="rtl"] .ff-submit .ff-icon-plane {
    transform: scaleX(-1);
}

.ff-submit:active:not(:disabled) { transform: translateY(0); }

.ff-submit:disabled {
    opacity: 0.85;
    cursor: not-allowed;
    transform: none;
}

.ff-submit.is-sending { pointer-events: none; }

.ff-submit.is-sending .ff-icon-plane {
    animation: ff-plane-fly 1.1s ease-in-out infinite;
}

@keyframes ff-plane-fly {
    0%   { transform: translateX(-30px) translateY(8px) rotate(-15deg) scale(0.85); opacity: 0; }
    20%  { opacity: 1; }
    50%  { transform: translateX(0) translateY(0) rotate(0) scale(1); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateX(30px) translateY(-8px) rotate(15deg) scale(0.85); opacity: 0; }
}

[dir="rtl"] .ff-submit.is-sending .ff-icon-plane {
    animation-name: ff-plane-fly-rtl;
}

@keyframes ff-plane-fly-rtl {
    0%   { transform: translateX(30px) translateY(8px) rotate(15deg) scale(0.85) scaleX(-1); opacity: 0; }
    20%  { opacity: 1; }
    50%  { transform: translateX(0) translateY(0) rotate(0) scale(1) scaleX(-1); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateX(-30px) translateY(-8px) rotate(-15deg) scale(0.85) scaleX(-1); opacity: 0; }
}

.ff-submit.is-sending .ff-submit-text::after {
    content: '';
    display: inline-block;
    width: 1em;
    text-align: start;
    animation: ff-dots 1.2s steps(4, end) infinite;
}

@keyframes ff-dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

.ff-status {
    margin: 16px 0 0;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-align: start;
    color: inherit;
    background-color: color-mix(in srgb, currentColor 6%, transparent);
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    line-height: 1.5;
}

.ff-status:empty { display: none; }

.ff-status-ok {
    color: #1a7f37;
    background-color: color-mix(in srgb, #1a7f37 10%, transparent);
    border-color: color-mix(in srgb, #1a7f37 28%, transparent);
    animation: ff-fade-in 0.4s ease-out;
}

.ff-status-err {
    color: #d92d20;
    background-color: color-mix(in srgb, #d92d20 10%, transparent);
    border-color: color-mix(in srgb, #d92d20 28%, transparent);
    animation: ff-fade-in 0.4s ease-out;
}

.ff-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

@media (prefers-color-scheme: dark) {
    .ff-toggle {
        color: #6cb6ff;
        border-color: color-mix(in srgb, #6cb6ff 35%, transparent);
    }
    .ff-toggle:hover {
        background-color: #6cb6ff;
        color: #181818;
        border-color: #6cb6ff;
    }
    .ff-logo {
        filter: invert(1);
    }
    .ff-status-ok  { color: #4ac26b; }
    .ff-status-err { color: #ff7a6c; }
}
