/*
 * form.css — Pixel-close clone of Google Forms M3 respondent view.
 *
 * Loads Google Sans (display) + Roboto (body) via Google Fonts.
 * NOTE on self-hosting: if downstream networks block fonts.googleapis.com
 * (some corporate proxies / Mimecast do), drop the @import below and
 * self-host the two families in /assets/fonts/ via @font-face. The visual
 * tells of the clone still work with Roboto fallback.
 */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap');

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: #f0ebf8;
    font-family: 'Roboto', Arial, sans-serif;
    color: #202124;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding-bottom: 64px;
}

/* ---------- Account chip (top-right) ---------- */
.account-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 16px;
    height: 56px;
}

.account-chip {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 2px rgba(60,64,67,.3);
    transition: box-shadow .15s ease;
}

.account-chip:hover,
.account-chip:focus {
    box-shadow: 0 1px 3px rgba(60,64,67,.4), 0 4px 8px 3px rgba(60,64,67,.15);
}

.account-initial {
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
}

/* ---------- Form wrap ---------- */
.form-wrap {
    max-width: 768px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---------- Card primitive ---------- */
.card {
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(60,64,67,.06);
}

/* ---------- Header card ---------- */
.header-card {
    padding: 0;
    overflow: hidden;
}

.header-stripe {
    height: 10px;
    background: #673ab7;
}

.header-body {
    padding: 24px;
}

.form-title {
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 32px;
    color: #202124;
    margin: 0 0 8px 0;
}

.form-desc {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: #5f6368;
    margin: 0 0 18px 0;
    white-space: pre-line;
}

.form-required-note {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 13px;
    color: #d93025;
    margin: 0;
}

.req {
    color: #d93025;
    margin-left: 2px;
}

/* ---------- Field card ---------- */
.field-card {
    padding: 24px;
}

.field-label {
    display: block;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #202124;
    line-height: 20px;
    margin-bottom: 18px;
}

.fieldset-reset {
    border: 0;
    margin: 0;
    padding: 0;
}

/* ---------- Underline text input ---------- */
.input-underline {
    width: 100%;
    max-width: 432px;
    display: block;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 13px;
    color: #202124;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #dadce0;
    border-radius: 0;
    padding: 6px 0 8px 0;
    outline: none;
    transition: border-color .15s ease, border-width .15s ease;
}

.input-underline::placeholder {
    color: #80868b;
    font-style: italic;
    opacity: 1;
}

.input-underline:hover {
    border-bottom-color: #80868b;
}

.input-underline:focus {
    border-bottom: 2px solid #673ab7;
    /* avoid layout shift when border thickens */
    padding-bottom: 7px;
}

.input-date {
    max-width: 200px;
    font-family: 'Roboto', Arial, sans-serif;
}

/* ---------- Radio (Material) ---------- */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radio-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    cursor: pointer;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    color: #202124;
    line-height: 20px;
}

/* visually hide the native input, keep it focusable */
.md-radio {
    position: absolute;
    opacity: 0;
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.radio-dot {
    width: 20px;
    height: 20px;
    border: 2px solid #5f6368;
    border-radius: 50%;
    position: relative;
    flex: 0 0 auto;
    box-sizing: border-box;
    transition: border-color .15s ease;
    background: transparent;
}

.radio-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #673ab7;
    transform: translate(-50%, -50%) scale(0);
    transition: transform .12s ease;
}

.md-radio:checked + .radio-dot {
    border-color: #673ab7;
}

.md-radio:checked + .radio-dot::after {
    transform: translate(-50%, -50%) scale(1);
}

.md-radio:focus-visible + .radio-dot {
    box-shadow: 0 0 0 12px rgba(103,58,183,.08);
}

.radio-text {
    flex: 1;
}

/* ---------- Select (Material dropdown) ---------- */
.select-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.md-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    color: #202124;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 8px 36px 8px 12px;
    min-width: 220px;
    cursor: pointer;
    outline: none;
    transition: border-color .15s ease;
}

.md-select:hover {
    border-color: #80868b;
}

.md-select:focus {
    border-color: #673ab7;
    box-shadow: 0 0 0 1px #673ab7 inset;
}

.select-wrap::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #5f6368;
    pointer-events: none;
    transform: translateY(-50%);
}

/* ---------- Submit row ---------- */
.submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 0 4px;
    gap: 12px;
}

.btn-submit {
    font-family: 'Roboto', 'Google Sans', Arial, sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #ffffff;
    background: #673ab7;
    border: 0;
    border-radius: 4px;
    padding: 9px 24px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(60,64,67,.3);
    transition: background-color .15s ease, box-shadow .15s ease;
    letter-spacing: .25px;
}

.btn-submit:hover {
    background: #5c33a5;
    box-shadow: 0 1px 3px rgba(60,64,67,.4), 0 4px 8px 3px rgba(60,64,67,.15);
}

.btn-submit:active {
    background: #512da8;
}

.btn-clear {
    font-family: 'Roboto', Arial, sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #673ab7;
    background: transparent;
    border: 0;
    padding: 9px 8px;
    cursor: pointer;
    border-radius: 4px;
    letter-spacing: .25px;
}

.btn-clear:hover {
    background: rgba(103,58,183,.04);
}

/* ---------- "Nunca contraseñas" + footer ---------- */
.never-passwords {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 11px;
    color: #5f6368;
    text-align: left;
    padding: 14px 4px 0 4px;
    margin: 0;
    line-height: 16px;
}

.forms-footer {
    text-align: center;
    padding: 18px 0 8px 0;
}

.forms-wordmark {
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    font-size: 13px;
    color: #5f6368;
    letter-spacing: .25px;
}

/* ---------- Mobile (<600px) ---------- */
@media (max-width: 600px) {
    body {
        padding-bottom: 32px;
    }
    .form-wrap {
        padding: 0;
        gap: 8px;
    }
    .card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
    .header-body,
    .field-card {
        padding: 20px 16px;
    }
    .input-underline {
        max-width: 100%;
    }
    .submit-row {
        padding: 8px 16px 0 16px;
    }
    .never-passwords {
        padding: 14px 16px 0 16px;
    }
    .account-bar {
        padding: 8px 12px;
    }
}
