@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===================== DESIGN TOKENS ===================== */
:root {
    --primary: #1B3C34;
    --primary-hover: #14302a;
    --accent: #F26722;
    --accent-hover: #d9551a;
    --blue: #2563EB;
    --blue-hover: #1d4ed8;

    --bg-page: linear-gradient(135deg, #f5d0c5 0%, #f0e8e0 30%, #e8e8ec 70%, #d8dce8 100%);
    --card-bg: #ffffff;
    --border: #E2E8F0;
    --border-input: #D1D5DB;

    --text-main: #1A1A1A;
    --text-muted: #6B7280;
    --text-label: #374151;

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);

    --radius: 14px;
    --radius-sm: 8px;
    --radius-pill: 100px;

    color-scheme: light;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: #e8e0d8;
    color-scheme: light;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ===================== CANDIDATE PORTAL ===================== */

.portal-body {
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
}

#bg-glow {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.orb.one {
    width: 500px;
    height: 500px;
    background: #f5b8a0;
    top: -100px;
    left: -80px;
}

.orb.two {
    width: 600px;
    height: 600px;
    background: #c8d0e0;
    bottom: -120px;
    right: -80px;
    animation-delay: -5s;
}

.orb.three {
    width: 300px;
    height: 300px;
    background: #e8c4b8;
    top: 40%;
    left: 35%;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -20px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 30px) scale(0.95);
    }
}

.glass-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
}

.step-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 40px 36px;
    border: 1px solid var(--border);
    animation: fadeIn 0.4s ease;
}

/* ===================== ERROR MODAL ===================== */
.error-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-modal-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.error-modal-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.error-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
}

.error-modal-msg {
    font-size: 0.95rem;
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 24px;
}

.error-modal-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.error-modal-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.step-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 28px;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================== LOADER ===================== */
.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(242, 103, 34, 0.1);
    border-left-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===================== FORM ELEMENTS ===================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-label);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 60, 52, 0.1);
}

.field-error {
    color: #EF4444;
    /* Vibrant Red */
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 4px;
    display: block;
    min-height: 1.2em;
    /* Prevents layout jump */
}

/* ===================== FILE UPLOAD ZONE ===================== */
.file-upload-zone {
    background: rgba(255, 255, 255, 0.4);
    border: 2px dashed #CBD5E1;
    border-radius: var(--radius-sm);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.file-upload-zone:hover {
    border-color: var(--primary);
    background: rgba(27, 60, 52, 0.03);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.file-upload-zone svg {
    color: var(--primary);
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.file-upload-zone:hover svg {
    transform: scale(1.1);
}

.upload-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.file-name {
    display: block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

/* ===================== INTERVIEW SCREEN ===================== */
#step-interview.step-card {
    max-width: 540px;
}

#progress-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
    display: block;
}

#question-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.timer {
    width: 100%;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #FFF7ED;
    /* Ultra-light orange */
    border: 1px solid #FFEDD5;
    padding: 12px 20px;
    border-radius: 12px;
}

#answer-text {
    width: 100%;
    min-height: 180px;
    padding: 18px;
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 16px;
    font-family: inherit;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-main);
    resize: none;
    transition: all 0.3s ease;
    margin-bottom: 24px;
    outline: none;
}

#answer-text:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(27, 60, 52, 0.08);
}

#answer-text::placeholder {
    color: #94A3B8;
}

/* ===================== FINAL SCREEN ===================== */
.final-icon {
    width: 80px;
    height: 80px;
    background: #DCFCE7;
    color: #16A34A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.final-icon svg {
    width: 40px;
    height: 40px;
}

.icon-portal-lg {
    width: 42px;
    height: 42px;
}

.icon-portal-success {
    width: 48px;
    height: 48px;
}

.final-message {
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 32px;
}

.tg-promo-section {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 24px;
    margin-top: 32px;
}

.tg-promo-text {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--accent);
    display: inline-block;
}

.btn-tg {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-tg:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(242, 103, 34, 0.25);
}

/* ===================== BUTTONS ===================== */

.btn {
    width: 100%;
    padding: 13px 24px;
    border-radius: var(--radius-pill);
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn.primary {
    background: var(--primary);
    color: #ffffff;
}

.btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(27, 60, 52, 0.3);
}

/* ===================== PROGRESS BAR ===================== */

.progress-bar {
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
    margin-bottom: 20px;
    width: 100%;
}

#progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ===================== ADMIN PANEL ===================== */

.admin-body {
    background: #F1F5F9;
    /* Slightly darker gray as requested */
    min-height: 100vh;
    color: var(--text-main);
    font-size: 13px;
}

.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* ===================== LANG SWITCHER / FILTERS ===================== */

.lang-switcher,
.filter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.lang-switcher button,
.filter-btn {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-input);
    background: #fff;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-switcher button:hover:not(.active),
.filter-btn:hover:not(.active) {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(27, 60, 52, 0.12);
    color: var(--primary);
}

.lang-switcher button.active,
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===================== BULK ACTION BAR ===================== */

.bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1.5px solid #FFD8CC;
    border-radius: 8px;
    padding: 10px 20px;
    margin-bottom: 12px;
}

.bulk-bar span {
    color: #F26722;
    font-weight: 600;
    flex: 1;
}

.btn-delete-selected {
    background: #FEE2E2;
    /* Very light red */
    color: #EF4444;
    /* Bright red text */
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-delete-selected:hover {
    background: #FECACA;
    transform: translateY(-1px);
}

.btn-archive-selected {
    background: #DBEAFE;
    /* Very light blue */
    color: #2563EB;
    /* Bright blue text */
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-archive-selected:hover {
    background: #BFDBFE;
    transform: translateY(-1px);
}

/* ===================== CANDIDATES TABLE ===================== */

.candidate-list {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

#candidates-table {
    width: 100%;
    border-collapse: collapse;
}

#candidates-table th {
    padding: 16px 14px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: #ffffff;
    border-bottom: 1.5px solid #F1F5F9;
}

#candidates-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 12px;
    vertical-align: middle;
}

#candidates-table td:last-child {
    min-width: 200px;
    /* Ensure buttons don't stack */
}

#candidates-table tr:hover {
    background: #F8FAFC;
}

/* ===================== LANGUAGE BADGES ===================== */
.lang-badge {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.lang-ru,
.lang-uz,
.lang-en,
.lang-eng {
    background: #EEF2FF;
    color: #4F46E5;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    background: #fff !important;
    border: 2px solid currentColor;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-invited {
    color: #22C55E;
    border-color: #BBF7D0;
}

.status-invited::before {
    background: #22C55E;
}

.status-rejected {
    color: #EF4444;
    border-color: #FECACA;
}

.status-rejected::before {
    background: #EF4444;
}

.status-review {
    color: #F59E0B;
    border-color: #FEF3C7;
}

.status-review::before {
    background: #F59E0B;
}

.status-archived {
    color: #8B5CF6;
    border-color: #DDD6FE;
}

.status-archived::before {
    background: #8B5CF6;
}

/* ===================== ACTION BUTTONS ===================== */

.action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.admin-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--text-muted);
    background: #ffffff;
    border: 2px solid #94A3B8;
    /* Solid Gray Borders */
}

.admin-btn:hover {
    background: #F8FAFC;
    border-color: #64748B;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.decision-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-status-active {
    width: auto !important;
    min-width: 100px;
    height: 32px;
    padding: 0 16px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
}

.btn-invite {
    background: #ffffff;
    border: 2px solid #22C55E;
    color: #22C55E;
}

.btn-reject {
    background: #ffffff;
    border: 2px solid #F04438;
    color: #F04438;
}

.btn-invite:hover {
    background: #DCFCE7;
    border-color: #86EFAC;
}

.btn-reject:hover {
    background: #FEE2E2;
    border-color: #FCA5A5;
}

/* ===================== MODALS (GLOBAL FIXED) ===================== */

.modal-overlay,
#confirm-modal,
#qa-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content,
.confirm-card {
    background: #ffffff !important;
    /* Forces solid white background to fix transparency */
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
    overflow: hidden;
    position: relative;
    z-index: 10000;
}

#qa-modal .modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 24px;
    border-bottom: 1.5px solid #F1F5F9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.close-btn {
    background: #F1F5F9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s;
}

.close-btn:hover {
    background: #E2E8F0;
    color: var(--text-main);
}

.modal-body {
    padding: 28px;
    overflow-y: auto;
    line-height: 1.8;
}

.qa-item {
    padding: 24px 0;
    border-bottom: 2px solid #F1F5F9;
}

.qa-item:last-child {
    border-bottom: none;
}

.qa-q {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 14px;
}

.qa-a {
    color: #475569;
    background: #F8FAFC;
    padding: 12px 16px;
    border-radius: 8px;
    line-height: 1.6;
}

.ai-badge {
    display: inline-flex;
    padding: 2px 8px;
    background: #F0FDF4;
    color: #16A34A;
    border: 1px solid #BBF7D0;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 8px;
}

/* Thick border between QA items */

/* ===================== CONFIRM MODAL ===================== */

.confirm-card {
    padding: 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
}

.confirm-icon {
    font-size: 2.2rem;
    margin-bottom: 16px;
}

.confirm-msg {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

.confirm-submsg {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions button {
    flex: 1;
    height: 48px;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Danger Mode (Delete/Reject - Solid Green/Red Pill) */
.confirm-card.danger-mode .confirm-btn-yes {
    background: #F04438;
    /* Vibrant Red */
    color: #fff;
}

.confirm-card.danger-mode .confirm-btn-no {
    background: #12B76A;
    /* Vibrant Green */
    color: #fff;
}

/* Normal Mode (Invite/Archive - Blue Pill Design as requested) */
.confirm-card:not(.danger-mode) .confirm-btn-yes {
    background: #2563EB;
    color: #fff;
}

.confirm-card:not(.danger-mode) .confirm-btn-no {
    background: #ffffff;
    color: #2563EB;
    border: 1.5px solid #2563EB;
}

.confirm-actions button:hover {
    filter: brightness(0.95);
    transform: scale(0.98);
}

/* ===================== PAGINATION ===================== */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -1px;
    /* Overlap table border */
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid #F1F5F9;
    border-top: 1.5px solid #F1F5F9;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.pg-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pg-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748B;
    transition: all 0.2s;
}

.pg-num:hover {
    background: #F8FAFC;
    color: var(--text-main);
}

.pg-num.active {
    background: #F1F5F9;
    color: var(--text-main);
    font-weight: 600;
}

.pg-btn {
    padding: 10px 18px;
    border: 1.5px solid #E2E8F0;
    background: #ffffff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pg-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #F8FAFC;
}

.pg-btn:not(:disabled):hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

/* ===================== CHECKBOXES ===================== */

.row-checkbox,
#select-all {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid #94A3B8;
    /* Slightly thicker and neutral gray */
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    outline: none;
}

.row-checkbox:checked,
#select-all:checked {
    border-color: #64748B;
}

.row-checkbox:checked::after,
#select-all:checked::after {
    content: '✔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #475569;
    font-size: 14px;
}

/* ===================== SCROLLBAR ===================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}