:root {
    --bg-color: #f0ebf8;
    --card-bg: #ffffff;
    --primary: #673ab7;
    --text-main: #202124;
    --text-sec: #5f6368;
    --error: #d93025;
    --border: #dadce0;
    --font: 'Roboto', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    font-family: var(--font);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    padding: 20px 10px;
    min-height: 100vh;
}

.form-container {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-header-bar {
    background-color: var(--primary);
    height: 10px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.form-header-content {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    border: 1px solid var(--border);
    margin-top: -10px; /* pull up under the color bar */
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.form-title {
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 12px;
    line-height: 1.2;
}

.form-desc {
    font-size: 14px;
    color: var(--text-sec);
    line-height: 1.5;
    margin-bottom: 16px;
}

.form-required-hint {
    color: var(--error);
    font-size: 13px;
    border-top: 1px solid #f1f3f4;
    padding-top: 12px;
}

.form-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}
.form-card:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.form-label {
    display: block;
    font-size: 16px;
    margin-bottom: 16px;
}
.required {
    color: var(--error);
}

.form-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-bottom 0.2s;
}
.form-input:focus {
    border-bottom: 2px solid var(--primary);
}

.form-select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #fff;
}
.form-select:focus {
    border: 2px solid var(--primary);
    padding: 9px;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-bottom: 40px;
}

.btn-submit {
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.btn-submit:hover {
    background-color: #512da8;
}

.form-clear {
    color: var(--text-sec);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.form-clear:hover {
    background: #f1f3f4;
    border-radius: 4px;
}

/* OVERLAY & SPINNER */
.hidden { display: none !important; }

.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.popup-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
