/* ===== CONTACT PAGE ===== */
html {
    background-image: url(images/satelliteS2.png);
    background-size: 7em;
}

.CONTENTBODY {
	background-color: #f7f7f7;
}

.egps-contact {
    margin-top: 0.3em;
}

.egps-contact-address {
    margin-bottom: 1em;
}

.egps-contact-address-label {
    margin-bottom: 0.25em;
    font-weight: bold;
    color: #004170;
}

.egps-contact-company {
    margin-bottom: 0.2em;
    font-size: 1.1em;
    font-weight: bold;
    color: #00497d;
}

.egps-contact-addr {
    font-size: 1em;
    line-height: 1.35em;
}

.egps-contact-subject {
    background-color: #a8ffa8 !important;
}

.egps-contact-intro {
    margin: 1.4em 0 0.5em 0 !important;
    font-size: 1em;
    color: #00497d;
}

/* ===== FORM ===== */
.egps-contact-form {
    background-color: #e3e9f7;
    border: 1px solid #d9e0ee;
    border-radius: 0.5em;
    padding: 1.25em 1.5em 1.25em 1.5em;
    margin-top: 0.5em;
    box-sizing: border-box;
}

.egps-contact-field {
    margin-bottom: 0.9em;
}

.egps-contact-field label {
    display: block;
    margin-bottom: 0.3em;
    font-size: 0.85em;
    font-weight: bold;
    letter-spacing: 0.05em;
    color: #00497d;
    text-transform: uppercase;
}

.egps-contact-field input[type="text"],
.egps-contact-field input[type="email"],
.egps-contact-field input[type="tel"],
.egps-contact-field select,
.egps-contact-field textarea {
    width: 100%;
    padding: 0.55em 0.75em;
    border: 1px solid #c8d2e4;
    border-radius: 0.3em;
    background-color: #fff;
    font-family: inherit;
    font-size: 1em;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.egps-contact-field input:focus,
.egps-contact-field select:focus,
.egps-contact-field textarea:focus {
    outline: none;
    border-color: #004170;
    box-shadow: 0 0 0 2px rgba(0, 65, 112, 0.15);
}

.egps-contact-field textarea {
    resize: vertical;
    min-height: 7em;
    line-height: 1.4em;
}

/* ===== SUBMIT ROW ===== */
.egps-contact-submit {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1em;
    margin-top: 0.6em;
}

.egps-contact-error {
    color: #c50400;
    font-weight: bold;
    font-size: 0.9em;
    text-align: left;
    flex: 1;
}

.egps-contact-btn {
    display: inline-block;
    padding: 0.65em 1.75em;
    background-color: #004170;
    color: #fff !important;
    border: 2px solid #004170;
    border-radius: 0.3em;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.egps-contact-btn:hover {
    background-color: #005a9a !important;
    color: #fff !important;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
}

/* ===== THANK-YOU PANEL ===== */
.egps-contact-thanks {
    margin-top: 1em;
    padding: 1.5em 1em;
    background-color: #e6f4e6;
    border: 1px solid #b6dab4;
    border-left: 0.3em solid #2e8b2a;
    border-radius: 0.3em;
    color: #1f5a1c;
    text-align: center;
}

.egps-contact-thanks-icon {
    font-size: 2.5em;
    line-height: 1em;
    color: #2e8b2a;
    margin-bottom: 0.1em;
}

.egps-contact-thanks h3 {
    margin: 0.1em 0 0.3em 0;
    font-size: 1.25em;
    color: #1f5a1c;
}

.egps-contact-thanks p {
    margin: 0;
    font-size: 1.05em;
}

/* ===== RESPONSIVE ===== */
@media only screen and (max-width: 530px) {
    .egps-contact-form {
        padding: 1em 1em 1em 1em;
    }

    .egps-contact-submit {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5em;
    }

    .egps-contact-btn {
        width: 100%;
        text-align: center;
    }

    .egps-contact-error {
        text-align: center;
    }
}

/* Row: keep intro and the blinking indicator on the same line.
               Indicator is pushed all the way to the right edge. */
.egps-contact-intro-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    flex-wrap: wrap;
    width: 100%;
}

    .egps-contact-intro-row .egps-contact-intro {
        margin: 1.4em 0 0.5em 0 !important;
        flex: 0 1 auto;
    }

/* Stable outer wrapper gives the spin a fixed anchor point
               and reserves space so surrounding layout doesn't jitter.
               Square, roughly 1em per side, pinned to the far right. */
.egps-signal {
    display: inline-block;
    width: 0.6em;
    height: 0.6em;
    perspective: 400px;
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: 0.6em;
    margin-top: 0.7em;
}

/* The inner element carries the colour, glow, blink and spin.
               Two animations run in parallel on the same 6s timeline:
                 1) egps-signal-cycle  — colour + spin + jump
                 2) egps-signal-blink  — turn-signal style on/off flicker,
                                         paused during the spin windows. */
.egps-signal-inner {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background: #004170;
    box-shadow: 0 0 10px rgba(0, 65, 112, 0.9), 0 0 24px rgba(0, 65, 112, 0.6), inset 0 0 6px rgba(255, 255, 255, 0.18);
    transform-style: preserve-3d;
    will-change: transform, background-color, box-shadow, opacity;
    animation: egps-signal-cycle 6s linear infinite, egps-signal-blink 6s steps(1, end) infinite;
}

/* Colour + 3D flip "jump" transitions.
               Timeline (6s total):
                 0%   - 40%   blue, 3 turn-signal blinks
                 40%  - 50%   jump + spin, blue -> red
                 50%  - 90%   red, 3 turn-signal blinks
                 90%  - 100%  jump + spin, red -> blue */
@keyframes egps-signal-cycle {
    0%, 40% {
        background-color: #004170;
        box-shadow: 0 0 10px rgba(0, 65, 112, 0.9), 0 0 24px rgba(0, 65, 112, 0.6), inset 0 0 6px rgba(255, 255, 255, 0.18);
        transform: translateY(0) rotateY(0deg) scale(1);
    }

    45% {
        /* mid-jump: in the air, mid-spin, colour swap happens here */
        background-color: #7a2838;
        box-shadow: 0 0 18px rgba(207, 16, 12, 0.6), 0 0 36px rgba(207, 16, 12, 0.35);
        transform: translateY(-14px) rotateY(180deg) scale(1.08);
    }

    50%, 90% {
        background-color: #cf100c;
        box-shadow: 0 0 10px rgba(207, 16, 12, 0.9), 0 0 24px rgba(207, 16, 12, 0.6), inset 0 0 6px rgba(255, 255, 255, 0.18);
        transform: translateY(0) rotateY(360deg) scale(1);
    }

    95% {
        background-color: #5a2438;
        box-shadow: 0 0 18px rgba(0, 65, 112, 0.6), 0 0 36px rgba(0, 65, 112, 0.35);
        transform: translateY(-14px) rotateY(540deg) scale(1.08);
    }

    100% {
        background-color: #004170;
        box-shadow: 0 0 10px rgba(0, 65, 112, 0.9), 0 0 24px rgba(0, 65, 112, 0.6), inset 0 0 6px rgba(255, 255, 255, 0.18);
        transform: translateY(0) rotateY(720deg) scale(1);
    }
}

/* Turn-signal on/off opacity. 3 blinks per colour phase.
               Blink phase in each colour = 40% of 6s = 2.4s, so each of
               3 blinks = 0.8s (0.5s on, 0.3s off).
               During the spin windows (40-50% and 90-100%) we hold opacity
               at full so the colour swap is clearly visible. */
@keyframes egps-signal-blink {
    /* --- Blue blink 1 --- */
    0% {
        opacity: 1;
    }

    8.333% {
        opacity: 0.18;
    }
    /* --- Blue blink 2 --- */
    13.333% {
        opacity: 1;
    }

    21.667% {
        opacity: 0.18;
    }
    /* --- Blue blink 3 --- */
    26.667% {
        opacity: 1;
    }

    35% {
        opacity: 0.18;
    }
    /* --- Spin blue -> red (fully lit) --- */
    40% {
        opacity: 1;
    }

    50% {
        opacity: 1;
    }
    /* --- Red blink 1 --- */
    50.001% {
        opacity: 1;
    }

    58.333% {
        opacity: 0.18;
    }
    /* --- Red blink 2 --- */
    63.333% {
        opacity: 1;
    }

    71.667% {
        opacity: 0.18;
    }
    /* --- Red blink 3 --- */
    76.667% {
        opacity: 1;
    }

    85% {
        opacity: 0.18;
    }
    /* --- Spin red -> blue (fully lit) --- */
    90% {
        opacity: 1;
    }

    100% {
        opacity: 1;
    }
}

/* Accessibility: respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    .egps-signal-inner {
        animation: none;
        opacity: 1;
    }
}

/* On narrow screens, push the signal onto its own line under
               the intro rather than cramming it to the right. */
@media (max-width: 480px) {
    .egps-contact-intro-row {
        gap: 0.5em;
    }

    .egps-signal {
        margin-top: 0.2em;
    }
}
