/*
 * AMSYS contact form card (com_contact override in rt_amsyseu).
 *
 * Self-contained: the override drops the .com-contact wrapper and the
 * #contact-form id the theme's compiled CSS styles, so none of those rules
 * reach this card and nothing here has to fight them. Palette restated
 * from the theme (amsyseu_32.css), not invented.
 */

.amsc {
    --amsc-ink: #ffffff;
    --amsc-text: rgba(233, 238, 248, 0.92);
    --amsc-muted: rgba(168, 178, 198, 0.78);
    --amsc-faint: rgba(168, 178, 198, 0.55);
    --amsc-line: rgba(255, 255, 255, 0.1);
    --amsc-field: rgba(255, 255, 255, 0.035);
    --amsc-field-line: rgba(255, 255, 255, 0.13);
    --amsc-violet: #6c3bf5;
    --amsc-violet-2: #7a5bff;
    --amsc-lilac: #a78bff;
    --amsc-cyan: #22e1ff;
    --amsc-error: #ff6b6b;
    --amsc-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.amsc-card {
    position: relative;
    padding: 2.5rem;
    border-radius: 22px;
    border: 1px solid var(--amsc-line);
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(34, 225, 255, 0.07), transparent 55%),
        linear-gradient(160deg, rgba(108, 59, 245, 0.13), rgba(255, 255, 255, 0.02) 60%);
    box-shadow: 0 30px 80px rgba(3, 5, 12, 0.45);
    overflow: hidden;
}

/* A hairline of the brand gradient along the top edge. */
.amsc-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--amsc-violet) 30%, var(--amsc-cyan) 70%, transparent);
    opacity: 0.8;
}

.amsc-head {
    margin-bottom: 2rem;
}

.amsc-head .am-eyebrow {
    margin-bottom: 0.9rem;
}

.amsc-title {
    margin: 0 0 0.6rem;
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.015em;
    line-height: 1.15;
    color: var(--amsc-ink);
    text-transform: none;
}

.amsc-lede {
    margin: 0;
    max-width: 34rem;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--amsc-muted);
}

.amsc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem 1.25rem;
}

.amsc-field {
    position: relative;
    min-width: 0;
}

.amsc-field--wide {
    grid-column: 1 / -1;
}

.amsc-label {
    display: block;
    margin: 0 0 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(233, 238, 248, 0.78);
}

.amsc .amsc-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.95rem 1.1rem;
    border-radius: 14px;
    border: 1px solid var(--amsc-field-line);
    background: var(--amsc-field);
    color: var(--amsc-ink);
    font: inherit;
    font-size: 0.9375rem;
    font-style: normal;
    line-height: 1.5;
    box-shadow: none;
    transition: border-color 200ms var(--amsc-ease), background 200ms var(--amsc-ease), box-shadow 200ms var(--amsc-ease);
    -webkit-appearance: none;
    appearance: none;
}

.amsc .amsc-input::placeholder {
    color: var(--amsc-faint);
    opacity: 1;
}

.amsc .amsc-input:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.amsc .amsc-input:focus {
    outline: none;
    border-color: rgba(139, 108, 255, 0.75);
    background: rgba(108, 59, 245, 0.08);
    box-shadow: 0 0 0 4px rgba(108, 59, 245, 0.18);
}

/* Browser autofill would otherwise paint the field pale yellow. */
.amsc .amsc-input:-webkit-autofill,
.amsc .amsc-input:-webkit-autofill:hover,
.amsc .amsc-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--amsc-ink);
    caret-color: var(--amsc-ink);
    -webkit-box-shadow: 0 0 0 1000px #15132a inset;
    transition: background-color 9999s;
}

.amsc .amsc-textarea {
    min-height: 11rem;
    resize: vertical;
}

.amsc-count {
    margin-top: 0.4rem;
    text-align: right;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--amsc-faint);
    min-height: 1.1em;
}

.amsc-count.is-near {
    color: var(--amsc-lilac);
}

/* Joomla's validator marks the field and the label `.invalid`. */
.amsc .amsc-input.invalid,
.amsc .amsc-input[aria-invalid="true"] {
    border-color: rgba(255, 107, 107, 0.75);
    background: rgba(255, 107, 107, 0.06);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.12);
}

.amsc-label.invalid {
    color: var(--amsc-error);
}

/* Joomla's validator appends its message INSIDE the label. Kept on the
   label's line, so an error never pushes one column below the other. */
.amsc .form-control-feedback,
.amsc .invalid-feedback {
    display: inline;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--amsc-error);
}

.amsc .form-control-feedback::before,
.amsc .invalid-feedback::before {
    content: "\2014\00a0";
    opacity: 0.6;
}

.amsc-extra .control-group {
    margin: 0;
}

.amsc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.amsc-note {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0;
    max-width: 22rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--amsc-muted);
}

.amsc-note svg {
    flex: none;
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.1rem;
    fill: none;
    stroke: var(--amsc-cyan);
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.amsc-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    flex: none;
    margin: 0;
    padding: 1rem 1.9rem 1rem 2.1rem;
    border: 0;
    border-radius: 999px;
    /* The theme's gradient ends on #22e1ff, where white text measures
       1.58:1. Dark ink holds AA across the whole ramp. */
    background: linear-gradient(100deg, var(--amsc-violet) 0%, var(--amsc-violet-2) 45%, var(--amsc-cyan) 100%);
    background-size: 160% 100%;
    background-position: 0 0;
    color: #04121a;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 12px 34px rgba(108, 59, 245, 0.38);
    transition: transform 240ms var(--amsc-ease), box-shadow 240ms var(--amsc-ease), background-position 400ms var(--amsc-ease), opacity 200ms;
}

.amsc-send svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 240ms var(--amsc-ease);
}

.amsc-send:hover,
.amsc-send:focus-visible {
    transform: translateY(-2px);
    background-position: 100% 0;
    box-shadow: 0 18px 44px rgba(108, 59, 245, 0.5);
}

.amsc-send:hover svg {
    transform: translateX(3px);
}

.amsc-send:focus-visible {
    outline: 2px solid var(--amsc-cyan);
    outline-offset: 3px;
}

.amsc-send:active {
    transform: translateY(0);
}

.amsc-send[disabled] {
    cursor: progress;
    opacity: 0.75;
    transform: none;
}

.amsc-send[disabled] svg {
    animation: amsc-pulse 1s var(--amsc-ease) infinite;
}

@keyframes amsc-pulse {
    50% { transform: translateX(4px); opacity: 0.4; }
}

@media (max-width: 767px) {
    .amsc-card {
        padding: 1.6rem 1.25rem;
        border-radius: 18px;
    }

    .amsc-grid {
        grid-template-columns: 1fr;
    }

    .amsc-foot {
        flex-direction: column;
        align-items: stretch;
    }

    .amsc-note {
        max-width: none;
    }

    .amsc-send {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .amsc-input,
    .amsc-send,
    .amsc-send svg {
        transition: none;
    }

    .amsc-send[disabled] svg {
        animation: none;
    }
}

/* The aside beside the card sits flush with the section top; so does this. */
.g-amsyseu-main .g-content:has(.amsc) {
    padding-top: 0;
}
