@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ================================================================
   GNH Talent Portal — shadcn/ui Inspired Theme
   ================================================================ */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
    --background:           #ffffff;
    --foreground:           #09090b;
    --card:                 #ffffff;
    --card-foreground:      #09090b;
    --primary:              #2563eb;
    --primary-hover:        #1d4ed8;
    --primary-foreground:   #ffffff;
    --secondary:            #f4f4f5;
    --secondary-foreground: #18181b;
    --muted:                #f4f4f5;
    --muted-foreground:     #71717a;
    --accent:               #f4f4f5;
    --destructive:          #ef4444;
    --border:               #e4e4e7;
    --input:                #e4e4e7;
    --ring:                 #2563eb;
    --radius:               0.5rem;
    --radius-sm:            0.375rem;
    --radius-lg:            0.75rem;
}

/* ── Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: #fafafa;
    color: var(--foreground);
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.page-container { max-width: 100%; }

/* ── Typography ────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    color: var(--foreground);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.display-5 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--foreground);
}

.lead {
    font-size: 1rem;
    color: var(--muted-foreground);
    font-weight: 400;
}

.fw-bold   { font-weight: 600 !important; }
.fw-medium { font-weight: 500 !important; }
.small, small { font-size: 0.8125rem; }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    overflow: visible;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.9375rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    border-bottom: none;
    color: #fff !important;
}
.card-header.bg-primary h1,
.card-header.bg-primary h2,
.card-header.bg-primary h3,
.card-header.bg-primary h4,
.card-header.bg-primary p  { color: #fff !important; }

.card-body   { padding: 1.5rem; }
.card-footer {
    background-color: var(--muted);
    border-top: 1px solid var(--border);
    padding: 0.875rem 1.5rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
}

.shadow-lg { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05) !important; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.5;
    vertical-align: middle;
}

.btn:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
    box-shadow: 0 2px 4px rgba(37,99,235,0.2);
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--border);
    color: var(--secondary-foreground);
}
.btn-secondary:hover { background-color: #e8e8e9; color: var(--foreground); }

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-outline-secondary {
    background-color: transparent;
    border-color: var(--border);
    color: var(--muted-foreground);
}
.btn-outline-secondary:hover {
    background-color: var(--secondary);
    color: var(--foreground);
    border-color: var(--border);
}

.btn-outline-light {
    background-color: transparent;
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}
.btn-outline-light:hover {
    background-color: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.6);
    color: #fff;
}

.btn-outline-info {
    background-color: transparent;
    border-color: #0ea5e9;
    color: #0ea5e9;
}
.btn-outline-info:hover { background-color: #0ea5e9; color: #fff; }

.btn-warning {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}
.btn-warning:hover { background-color: #d97706; border-color: #d97706; color: #fff; }

.btn-light {
    background-color: var(--secondary);
    border-color: var(--border);
    color: var(--foreground);
}
.btn-light:hover { background-color: #e8e8e9; }

.btn-danger {
    background-color: var(--destructive);
    border-color: var(--destructive);
    color: #fff;
}
.btn-danger:hover { background-color: #dc2626; border-color: #dc2626; }

.btn-sm  { font-size: 0.8125rem; padding: 0.3125rem 0.75rem; }
.btn-lg  { font-size: 0.9375rem; padding: 0.625rem 1.5rem; }

/* ── Forms ─────────────────────────────────────────────────────── */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.5;
    color: var(--foreground);
    background-color: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius-sm);
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 0;
}

.form-control:focus,
.form-select:focus {
    color: var(--foreground);
    background-color: var(--background);
    border-color: var(--ring);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder { color: var(--muted-foreground); opacity: 1; }
.form-control:disabled     { background-color: var(--muted); color: var(--muted-foreground); cursor: not-allowed; }

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.375rem;
    display: block;
}

.form-text  { font-size: 0.8125rem; color: var(--muted-foreground); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* ── Input Group ───────────────────────────────────────────────── */
.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    background-color: var(--muted);
    border: 1px solid var(--input);
    border-radius: var(--radius-sm);
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .btn            { border-radius: 0 !important; margin-bottom: 0 !important; }
.input-group > .input-group-text { border-radius: 0 !important; margin-bottom: 0 !important; }
.input-group > :first-child    { border-top-left-radius: var(--radius-sm) !important; border-bottom-left-radius: var(--radius-sm) !important; }
.input-group > :last-child     { border-top-right-radius: var(--radius-sm) !important; border-bottom-right-radius: var(--radius-sm) !important; }

/* ── Tables ────────────────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: var(--foreground);
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground);
    background-color: var(--muted);
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--foreground);
}

.table-hover tbody tr:hover td  { background-color: #f9fafb; }
.table-bordered th,
.table-bordered td              { border: 1px solid var(--border) !important; }
.table-light                    { background-color: var(--muted) !important; }

/* ── Badges ────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    letter-spacing: 0.01em;
}

.bg-success  { background-color: #dcfce7 !important; color: #166534 !important; border: 1px solid #bbf7d0; }
.bg-danger   { background-color: #fee2e2 !important; color: #991b1b !important; border: 1px solid #fecaca; }
.bg-warning  { background-color: #fef9c3 !important; color: #854d0e !important; border: 1px solid #fde047; }
.bg-info     { background-color: #e0f2fe !important; color: #075985 !important; border: 1px solid #bae6fd; }
.bg-secondary{ background-color: var(--muted) !important; color: var(--muted-foreground) !important; border: 1px solid var(--border); }
.bg-primary  { background-color: #dbeafe !important; color: #1d4ed8 !important; border: 1px solid #bfdbfe; }

/* ── Alerts ────────────────────────────────────────────────────── */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.alert-info    { background-color: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-success { background-color: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger  { background-color: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background-color: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast-container { z-index: 9999 !important; }

.toast {
    background-color: var(--card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04) !important;
    min-width: 280px;
    max-width: 380px;
}

.toast .toast-body {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    padding: 0.875rem 1rem;
}

.text-bg-success .toast-body { color: #166534 !important; }
.text-bg-danger  .toast-body { color: #991b1b !important; }
.text-bg-warning .toast-body { color: #92400e !important; }
.text-bg-primary .toast-body { color: #1e40af !important; }
.text-bg-info    .toast-body { color: #075985 !important; }
.toast .btn-close { opacity: 0.5; }

/* ── Pagination ────────────────────────────────────────────────── */
.pagination .page-link {
    font-size: 0.875rem;
    color: var(--foreground);
    background-color: var(--background);
    border-color: var(--border);
    border-radius: var(--radius-sm) !important;
    margin: 0 0.125rem;
    padding: 0.375rem 0.75rem;
}
.pagination .page-link:hover  { background-color: var(--secondary); color: var(--foreground); border-color: var(--border); }
.pagination .page-item.active .page-link { background-color: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .page-item.disabled .page-link { color: var(--muted-foreground); background-color: var(--muted); }

/* ── Progress Bar ───────────────────────────────────────────────── */
.progress {
    height: 0.5rem;
    background-color: var(--muted);
    border-radius: 9999px;
    overflow: hidden;
}
.progress-bar {
    background-color: var(--primary);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

/* ── Spinners ───────────────────────────────────────────────────── */
.spinner-border { color: var(--primary); }

/* ── List Groups ────────────────────────────────────────────────── */
.list-group-item { border-color: var(--border); font-size: 0.875rem; color: var(--foreground); }
.list-group-item.bg-transparent { background-color: transparent !important; }

/* ── Utility Overrides ──────────────────────────────────────────── */
.text-muted     { color: var(--muted-foreground) !important; }
.text-primary   { color: var(--primary) !important; }
.text-success   { color: #16a34a !important; }
.text-danger    { color: var(--destructive) !important; }
.text-dark      { color: var(--foreground) !important; }
.text-secondary { color: var(--muted-foreground) !important; }
.bg-light       { background-color: var(--muted) !important; }
.bg-white       { background-color: #fff !important; }
.border         { border-color: var(--border) !important; }
.border-top     { border-top-color: var(--border) !important; }
.border-0       { border: none !important; }
.rounded-4      { border-radius: var(--radius-lg) !important; }

/* ── Admin Layout ───────────────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ─ Sidebar (dark) ─ */
.admin-sidebar {
    width: 240px;
    min-width: 240px;
    background-color: #0f172a;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.25s ease;
}

.admin-sidebar-logo {
    height: 60px;
    padding: 0 1.25rem;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.admin-sidebar-brand { display: flex; flex-direction: column; }
.admin-sidebar-brand-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.admin-sidebar-brand-sub {
    font-size: 0.6875rem;
    color: #475569;
    font-weight: 500;
}

.admin-sidebar-nav {
    flex: 1;
    padding: 0.875rem 0.75rem;
    overflow-y: auto;
}

.admin-nav-section {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #334155;
    padding: 0.875rem 0.625rem 0.375rem;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
    margin-bottom: 0.125rem;
    border: none;
    cursor: pointer;
    width: 100%;
    background: none;
    text-align: left;
    border-left: 2px solid transparent;
}

.admin-nav-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: #e2e8f0;
    text-decoration: none;
}

.admin-nav-item.active {
    background-color: rgba(59,130,246,0.15);
    color: #93c5fd;
    border-left-color: #3b82f6;
}

.admin-nav-item i {
    width: 1rem;
    text-align: center;
    font-size: 0.9375rem;
    flex-shrink: 0;
}

.admin-sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid #1e293b;
    background-color: rgba(0,0,0,0.15);
}

.admin-user-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    background-color: rgba(255,255,255,0.04);
}

.admin-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0;
}

.admin-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.2;
}

.admin-user-role {
    font-size: 0.6875rem;
    color: #475569;
}

/* ─ Main area ─ */
.admin-main {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8fafc;
}

/* ─ Topbar ─ */
.admin-topbar {
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}

.admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    flex: 1;
    min-width: 0;
}

.admin-breadcrumb a {
    color: var(--muted-foreground);
    text-decoration: none;
}
.admin-breadcrumb a:hover { color: var(--foreground); }
.admin-breadcrumb-sep { color: #d4d4d8; }
.admin-breadcrumb-current {
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.admin-topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0;
}

/* ─ Content ─ */
.admin-content {
    flex: 1;
    padding: 1.5rem;
}

/* ─ Stat cards ─ */
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--foreground);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin-top: 0.2rem;
}

/* ─ Mobile ─ */
.admin-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.375rem;
    color: var(--foreground);
    cursor: pointer;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
}
.admin-sidebar-toggle:hover { background-color: var(--muted); }

.admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

@media (max-width: 768px) {
    .admin-sidebar         { transform: translateX(-100%); }
    .admin-sidebar.open    { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,0.4); }
    .admin-main            { margin-left: 0; }
    .admin-sidebar-toggle  { display: flex; }
    .admin-content         { padding: 1rem; }
}

/* ── Register / Wizard ──────────────────────────────────────────── */
.wizard-step     { display: none; }
.wizard-step.active { display: block; }

.progress-wizard {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    position: relative;
    padding: 0 0.5rem;
}

.progress-wizard::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 1;
    transform: translateY(-50%);
}

.wizard-item {
    position: relative;
    z-index: 2;
    background: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    transition: all 0.2s ease;
}

.wizard-item.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.15);
}

.wizard-item.completed {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
}

.wizard-label {
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-foreground);
    letter-spacing: 0.01em;
}

.wizard-item.active .wizard-label { color: var(--primary); }

.form-section-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1.25rem;
    padding-left: 0.875rem;
    border-left: 3px solid var(--primary);
}

/* ── Public Page Container ──────────────────────────────────────── */
.public-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1rem;
    background-color: #f8fafc;
}

.public-page-inner {
    width: 100%;
    max-width: 1024px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Misc ───────────────────────────────────────────────────────── */
.text-justify { text-align: justify; }
.opacity-75   { opacity: 0.75; }

@media (max-width: 640px) {
    .card-body     { padding: 1rem; }
    .display-5     { font-size: 1.75rem; }
    .btn-lg        { padding: 0.5rem 1rem; font-size: 0.9375rem; }
    .wizard-nav    { flex-direction: column-reverse; gap: 0.75rem; }
    .wizard-nav .btn { width: 100%; }
    .form-section-title { font-size: 0.9375rem; }
    #otp { max-width: 100% !important; letter-spacing: 8px !important; }
}

/* ── Bootstrap / Tailwind Conflict Fix ─────────────────────────────
   Tailwind's .collapse utility sets visibility:collapse which breaks
   Bootstrap accordion/collapse components. Force visibility visible
   for Bootstrap's expanded and animating states.
─────────────────────────────────────────────────────────────────── */
.collapse.show,
.collapsing {
    visibility: visible !important;
}
