/* ===== Contact page ===== */

.contact-layout {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
    text-align: left;
}

@media (min-width: 900px) {
    .contact-layout {
        grid-template-columns: 3fr 2fr;   /* form wider than the "prefer to talk" card */
        align-items: start;
    }
}

/* ----- The form ----- */
.contact-form {
    display: grid;
    gap: 1.25rem;
    padding: 2.5rem 2rem;
    border-radius: 1.5rem;
    background: var(--cream);
}

.form-field {
    display: grid;
    gap: 0.4rem;
}

.form-field label {
    font-weight: 600;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    background: var(--off-white);
    color: var(--sage);
    font: inherit;
}

.form-field textarea {
    resize: vertical;             /* people can make it taller, not wider */
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--sage);    /* a clear border shows where you're typing */
}

/* Django's error messages */
.errorlist {
    list-style: none;
    padding: 0;
    color: #A3442F;               /* a warm, readable red */
    font-size: 0.9rem;
    font-weight: 500;
}

.contact-form .btn {
    justify-self: start;          /* button only as wide as its words */
}

/* ----- Spam trap: moved off screen, not "display: none" ----- */
.form-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ----- Thank you message ----- */
.form-success {
    max-width: 32rem;
    margin: 2rem auto 0;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    background: var(--mint);
    font-weight: 500;
}

/* ----- Prefer to talk? ----- */
.contact-aside {
    padding: 2.5rem 2rem;
    border-radius: 1.5rem;
    background: var(--sage);
    color: var(--off-white);
}

.contact-aside h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.contact-aside p {
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* ===== Paper plane send button ===== */
.contact-page {
    overflow: clip;               /* the plane can fly off without adding a sideways scrollbar */
}

.send-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.send-plane {
    fill: none;
    stroke: currentColor;         /* same colour as the button text */
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

/* A little "ready for take-off" wiggle on hover */
.send-btn:hover .send-plane,
.send-btn:focus-visible .send-plane {
    transform: translate(3px, -3px) rotate(-8deg);
}

/* Take-off! (spider... sorry, plane.js adds this class) */
.send-btn.is-flying .send-label {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.send-btn.is-flying .send-plane {
    animation: plane-fly 0.9s ease-in forwards;
}

@keyframes plane-fly {
    0%   { transform: none; }
    20%  { transform: translate(-6px, 4px) rotate(-10deg); }       /* pulls back... */
    100% { transform: translate(320px, -260px) rotate(-20deg) scale(0.6); opacity: 0; }   /* ...and whoosh! */
}

@media (prefers-reduced-motion: reduce) {
    .send-btn.is-flying .send-plane {
        animation: none;
    }
}