/* style.css */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Roboto:wght@400;500&display=swap');

/* ==================== RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

/* ==================== BODY ==================== */
body {
    font-family: 'Roboto', 'Google Sans', Arial, sans-serif;
    background-color: #e8eaf6;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 16px 40px;
}

/* ==================== FORM CONTAINER ==================== */
.form-container {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==================== HEADING (Google Form Title Bar) ==================== */
h2 {
    background: #ffffff;
    color: #202124;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.35;
    padding: 24px 24px 20px;
    border-radius: 10px;
    border-top: 10px solid #4285f4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1),
                0 1px 3px rgba(0, 0, 0, 0.06);
    word-wrap: break-word;
    position: relative;
}

h2::after {
    content: 'All fields are mandatory *';
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    color: #d93025;
    margin-top: 10px;
    font-family: 'Roboto', sans-serif;
}

/* ==================== FORM ==================== */
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==================== FORM FIELD GROUP ==================== */
/* Each label + input pair wrapped visually as a card */
label {
    display: block;
    background: #ffffff;
    padding: 22px 24px 6px;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1),
                0 1px 3px rgba(0, 0, 0, 0.06);
    font-size: 0.95rem;
    font-weight: 500;
    color: #202124;
    line-height: 1.5;
    cursor: default;
    position: relative;
    margin-bottom: 0;
    border-left: 0px solid transparent;
    transition: border-left 0.2s ease;
}

label::after {
    content: ' *';
    color: #d93025;
    font-weight: 400;
}

/* Remove asterisk from workshop label (readonly feel) */
label[for="workshop"]::after {
    content: '';
}

/* ==================== INPUTS ==================== */
input[type="text"],
input[type="email"] {
    display: block;
    width: 100%;
    padding: 12px 0;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    color: #202124;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid #dadce0;
    outline: none;
    transition: border-color 0.3s ease;
    margin-top: 4px;
    margin-bottom: 12px;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus {
    border-bottom: 2.5px solid #4285f4;
    margin-bottom: 11px; /* compensate for thicker border */
}

input[type="text"]:hover:not(:focus),
input[type="email"]:hover:not(:focus) {
    border-bottom-color: #80868b;
}

/* Readonly */
input[readonly] {
    color: #5f6368;
    font-weight: 500;
    cursor: not-allowed;
    border-bottom-style: dotted;
}

/* ==================== SELECT DROPDOWNS ==================== */
select {
    display: block;
    width: 100%;
    padding: 12px 40px 12px 0;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    color: #202124;
    background-color: transparent;
    border: none;
    border-bottom: 1.5px solid #dadce0;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s ease;
    margin-top: 4px;
    margin-bottom: 12px;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 24px;
}

select:focus {
    border-bottom: 2.5px solid #4285f4;
    margin-bottom: 11px;
}

select:hover:not(:focus) {
    border-bottom-color: #80868b;
}

/* ==================== SUBMIT BUTTON ==================== */
button[type="submit"] {
    align-self: flex-start;
    padding: 10px 32px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    color: #ffffff;
    background-color: #4285f4;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.25px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(66, 133, 244, 0.3);
    margin-top: 4px;
    min-height: 36px;
    -webkit-tap-highlight-color: transparent;
}

button[type="submit"]:hover {
    background-color: #3367d6;
    box-shadow: 0 2px 6px rgba(66, 133, 244, 0.4);
}

button[type="submit"]:active {
    background-color: #2a56c6;
    box-shadow: 0 1px 2px rgba(66, 133, 244, 0.3);
}

button[type="submit"]:focus-visible {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

/* ==================== PLACEHOLDER ==================== */
::placeholder {
    color: #80868b;
    font-weight: 400;
}

/* ============================================================
   RESPONSIVE - TABLET (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    body {
        padding: 20px 14px 36px;
    }

    h2 {
        font-size: 1.5rem;
        padding: 22px 22px 18px;
        border-top-width: 8px;
    }

    label {
        padding: 20px 22px 6px;
    }
}

/* ============================================================
   RESPONSIVE - MOBILE (≤ 600px)
   ============================================================ */
@media (max-width: 600px) {
    body {
        padding: 0;
        background-color: #e8eaf6;
        min-height: 100dvh;
        justify-content: flex-start;
    }

    .form-container {
        max-width: 100%;
        gap: 10px;
        padding: 12px 12px 32px;
        min-height: 100dvh;
    }

    /* Title Card */
    h2 {
        font-size: 1.35rem;
        padding: 20px 18px 16px;
        border-radius: 8px;
        border-top-width: 8px;
        line-height: 1.4;
    }

    h2::after {
        font-size: 0.8rem;
        margin-top: 8px;
    }

    /* Field Cards */
    form {
        gap: 10px;
    }

    label {
        padding: 18px 18px 6px;
        border-radius: 8px;
        font-size: 0.9rem;
    }

    /* Inputs */
    input[type="text"],
    input[type="email"] {
        padding: 12px 0;
        font-size: 16px; /* Prevents iOS auto-zoom */
        min-height: 44px; /* Touch target */
    }

    /* Selects */
    select {
        padding: 12px 36px 12px 0;
        font-size: 16px;
        min-height: 44px;
    }

    /* Button */
    button[type="submit"] {
        width: 100%;
        text-align: center;
        padding: 14px 32px;
        font-size: 1rem;
        min-height: 48px;
        border-radius: 6px;
        margin-top: 6px;
    }
}

/* ============================================================
   RESPONSIVE - SMALL PHONES (≤ 400px)
   ============================================================ */
@media (max-width: 400px) {
    .form-container {
        padding: 8px 8px 28px;
        gap: 8px;
    }

    h2 {
        font-size: 1.2rem;
        padding: 18px 16px 14px;
        border-radius: 8px;
        border-top-width: 6px;
    }

    h2::after {
        font-size: 0.75rem;
    }

    form {
        gap: 8px;
    }

    label {
        padding: 16px 14px 4px;
        border-radius: 8px;
        font-size: 0.85rem;
    }

    input[type="text"],
    input[type="email"] {
        font-size: 16px;
        padding: 10px 0;
    }

    select {
        font-size: 16px;
        padding: 10px 32px 10px 0;
    }

    button[type="submit"] {
        padding: 13px 24px;
        font-size: 0.95rem;
    }
}

/* ============================================================
   RESPONSIVE - TINY PHONES (≤ 340px)
   ============================================================ */
@media (max-width: 340px) {
    .form-container {
        padding: 6px 6px 24px;
    }

    h2 {
        font-size: 1.1rem;
        padding: 16px 14px 12px;
    }

    label {
        padding: 14px 12px 4px;
        font-size: 0.82rem;
    }

    input[type="text"],
    input[type="email"],
    select {
        font-size: 16px;
        padding: 10px 0;
    }

    button[type="submit"] {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ============================================================
   LANDSCAPE MODE
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 12px;
    }

    .form-container {
        min-height: auto;
        padding: 12px;
    }

    h2 {
        font-size: 1.2rem;
        padding: 16px 18px 12px;
    }

    label {
        padding: 14px 18px 4px;
    }

    input[type="text"],
    input[type="email"],
    select {
        padding: 10px 0;
    }

    button[type="submit"] {
        width: auto;
        padding: 10px 28px;
    }
}

/* ============================================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
    input[type="text"],
    input[type="email"],
    select {
        min-height: 44px;
    }

    button[type="submit"] {
        min-height: 48px;
    }

    /* Disable hover effects on touch */
    button[type="submit"]:hover {
        background-color: #4285f4;
        box-shadow: 0 1px 3px rgba(66, 133, 244, 0.3);
    }

    button[type="submit"]:active {
        background-color: #2a56c6;
        transform: scale(0.98);
    }
}

/* ============================================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}