/* Bluemerk Onboarding Portal Design System */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.12);
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    height: 68px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge-role {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.nav-admin-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.nav-admin-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* Main Container */
.main-container {
    flex: 1;
    max-width: 860px;
    width: 100%;
    margin: 36px auto;
    padding: 0 20px;
}

/* State Cards */
.state-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 60px 32px;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin: 40px auto;
    max-width: 560px;
}

.state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 20px;
}

.error-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.success-icon {
    background: var(--success-light);
    color: var(--success);
}

.state-card h3 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 10px;
}

.state-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.support-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.support-hint a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* Portal Card */
.portal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.portal-header {
    padding: 36px 36px 28px;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border-bottom: 1px solid var(--border);
}

.role-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: 14px;
    margin-bottom: 12px;
}

.welcome-meta h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 6px;
}

.welcome-meta p {
    font-size: 0.94rem;
    color: var(--text-muted);
}

.progress-wrap {
    margin-top: 24px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Form Sections */
.form-section {
    padding: 32px 36px;
    border-bottom: 1px solid var(--border);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.section-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-title h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary);
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 40px;
    margin-bottom: 20px;
}

/* Fields Grid */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

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

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.form-group input,
.form-group select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Document Checklist Items */
.documents-checklist {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
}

.doc-upload-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.15s ease;
}

.doc-upload-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.doc-upload-card.uploaded {
    background: var(--success-light);
    border-color: #bbf7d0;
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-header-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.doc-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary);
}

.doc-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
}

.tag-required {
    background: #fee2e2;
    color: #dc2626;
}

.tag-optional {
    background: #f1f5f9;
    color: #64748b;
}

.doc-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.doc-file-status {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

/* Upload Trigger Button */
.doc-action-wrap {
    flex-shrink: 0;
}

.btn-upload {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.btn-upload:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.doc-upload-card.uploaded .btn-upload {
    background: #ffffff;
    color: var(--success);
    border-color: #86efac;
}

/* Declaration Section */
.declaration-section {
    background: #f8fafc;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-main);
}

.checkbox-container input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Submit Action Bar */
.submit-action-bar {
    padding: 28px 36px;
    display: flex;
    justify-content: flex-end;
    background: #ffffff;
}

.btn-submit {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
    transition: all 0.15s ease;
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 20px 32px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Spinners */
.spinner-large {
    width: 44px;
    height: 44px;
    border: 3.5px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.spinner-small {
    width: 24px;
    height: 24px;
    border: 2.5px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom Document Selector in Admin Console */
.custom-docs-selector-block {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 6px;
}

.custom-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.custom-docs-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.custom-doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease;
}

.custom-doc-item:hover {
    border-color: var(--primary);
}

.custom-doc-item-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.custom-doc-item-left input[type="checkbox"] {
    margin-top: 4px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.custom-doc-item-left label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--secondary);
}

.custom-doc-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.custom-doc-item-right select {
    padding: 5px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }
    .main-container {
        margin: 16px auto;
        padding: 0 12px;
    }
    .portal-header,
    .form-section,
    .submit-action-bar {
        padding: 20px 16px;
    }
    .fields-grid {
        grid-template-columns: 1fr;
    }
    .doc-upload-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .doc-action-wrap {
        width: 100%;
    }
    .btn-upload {
        width: 100%;
        justify-content: center;
    }
    .btn-submit {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================
   ADMIN DASHBOARD STYLES
   ========================================== */
.admin-body {
    background: #f1f5f9;
}

.admin-layout {
    min-height: 100vh;
}

.admin-main {
    max-width: 1180px;
    width: 100%;
    margin: 28px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
}

.header-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.invite-form-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.invite-form-grid .form-action-row {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-outline.text-danger {
    color: var(--danger);
    border-color: #fecaca;
}

.btn-outline.text-danger:hover {
    background: var(--danger-light);
}

/* Generated Link Box */
.generated-link-box {
    margin: 0 24px 24px;
    padding: 16px 20px;
    background: var(--success-light);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
}

.gen-link-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--success);
    margin-bottom: 12px;
}

.link-copy-group {
    display: flex;
    gap: 10px;
}

.link-copy-group input {
    flex: 1;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.88rem;
    color: #0f172a;
}

.btn-copy {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.gen-email-tip {
    margin-top: 10px;
    font-size: 0.78rem;
    color: #15803d;
}

/* Admin Table */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    background: #f8fafc;
    padding: 12px 20px;
    text-align: left;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.candidate-name-cell {
    display: flex;
    flex-direction: column;
}

.c-name {
    font-weight: 700;
    color: var(--secondary);
}

.c-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
}

.status-pending {
    background: var(--warning-light);
    color: var(--warning);
}

.status-submitted {
    background: var(--success-light);
    color: var(--success);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
}

.modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 620px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-doc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.btn-download {
    background: var(--primary);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    inset: 0;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.auth-box {
    background: #ffffff;
    max-width: 400px;
    width: 100%;
    padding: 36px 30px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.auth-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}
