/* ─────────────────────────────────────────────────────────────────────────
   GTM Onboarding — Merged Stylesheet
   Sources: homepage.css + inline <style> block
   ───────────────────────────────────────────────────────────────────────── */

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* ── Body ──────────────────────────────────────────────────────────────── */
/* Removed full-screen flex centering + background image from original —
   the <nav> element breaks that centering layout. Layout is now handled
   by <main> below.                                                         */
body {
    background-image: url('technology-digital-sm.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-color: #f5f5f5;
    color: #1a1a1a;
    min-height: 100vh;
}

/* ── Navigation ────────────────────────────────────────────────────────── */
nav {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav .brand {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Replaces the inline style="display:flex; align-items:center;" on nav div */
.nav-actions {
    display: flex;
    align-items: center;
}

/* ── Auth button ───────────────────────────────────────────────────────── */
/* Scoped to #auth-btn so it doesn't inherit the generic button block       */
#auth-btn {
    padding: 0.4rem 1rem;
    border-radius: 6px;
    border: 1px solid #0078d4;
    background: #0078d4;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s;
    width: auto;
    margin-top: 0;
}

#auth-btn:hover                { background: #006cbf; }
#auth-btn.signed-in            { background: #fff; color: #0078d4; }
#auth-btn.signed-in:hover      { background: #f0f6ff; }

#user-name {
    font-size: 0.875rem;
    color: #555;
    margin-right: 0.75rem;
}

/* ── Main layout ───────────────────────────────────────────────────────── */
main {
    max-width: 1180px;
    margin: 3rem auto;
    padding: 0 1rem;
}

/* ── Login prompt ──────────────────────────────────────────────────────── */
#login-prompt {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

#login-prompt h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

#login-prompt p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Scoped so this button doesn't inherit the full-width .submit-btn block   */
#login-prompt button {
    padding: 0.6rem 1.5rem;
    background: #0078d4;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 400;
    cursor: pointer;
    width: auto;
    margin-top: 0;
}

#login-prompt button:hover { background: #006cbf; }

/* ── Authenticated workspace ───────────────────────────────────────────── */
#app-workspace {
    display: none;
    grid-template-columns: minmax(0, 600px) minmax(360px, 1fr);
    align-items: start;
    gap: 1.5rem;
}

/* ── Form card (.container / #form-section are the same element) ────────── */
.container {
    display: none;                           /* shown by JS after auth */
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    width: 100%;
}

.container h2 {
    margin-bottom: 1.5rem;
    color: #2286F8;
    text-align: center;
}

/* ── Pending users table ───────────────────────────────────────────────── */
.table-panel {
    display: none;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    width: 100%;
}

.table-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.table-panel h2 {
    color: #2286F8;
    font-size: 1.25rem;
}

.secondary-btn {
    width: auto;
    margin-top: 0;
    padding: 0.55rem 0.9rem;
    border: 1px solid #0078d4;
    border-radius: 8px;
    background: #fff;
    color: #0078d4;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.secondary-btn:hover:not(:disabled) {
    background: #f0f6ff;
}

.secondary-btn:disabled {
    border-color: #a0c4e8;
    color: #8aa9c5;
    cursor: not-allowed;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

th,
td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 0.9rem;
    vertical-align: top;
}

th {
    background: #f7fbff;
    color: #2286F8;
    font-weight: 700;
}

tbody tr:last-child td {
    border-bottom: none;
}

#table-status {
    display: none;
    margin-top: 0.85rem;
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

#table-status.success {
    display: block;
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #a8d5b5;
}

#table-status.error {
    display: block;
    background: #fdecea;
    color: #c62828;
    border: 1px solid #f5c2c0;
}

.notify-btn {
    margin-top: 1rem;
}

/* ── Form grid ─────────────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full {
    grid-column: span 2;
}

/* ── Labels ────────────────────────────────────────────────────────────── */
label {
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #2286F8;
}

/* ── Inputs & Selects ──────────────────────────────────────────────────── */
input,
select {
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.2s;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/csvg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.2em;
    padding-right: 2.5rem;
    cursor: pointer;
    color: #af81fc;
}

/* Replaces inline style="color: #af81fc;" on the date input               */
input[type="date"] {
    color: #af81fc;
}

input:focus,
select:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

/* ── Submit button ─────────────────────────────────────────────────────── */
/* Replaced the generic button {} block — kept original indigo brand color  */
.submit-btn {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    background: #4f46e5;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.submit-btn:hover:not(:disabled) {
    background: #af81fc;
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled {
    background: #a0c4e8;
    cursor: not-allowed;
}

/* ── Status banner ─────────────────────────────────────────────────────── */
#status {
    display: none;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

#status.success {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #a8d5b5;
}

#status.error {
    background: #fdecea;
    color: #c62828;
    border: 1px solid #f5c2c0;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: span 1;
    }
}

@media (max-width: 980px) {
    main {
        max-width: 640px;
    }

    #app-workspace {
        grid-template-columns: 1fr;
    }
}
