/* ═══════════════════════════════════════════
   client.css — NexEvent.tech Client Portal
   Apple-inspired dark theme
═══════════════════════════════════════════ */

:root {
    --bg: #030308;
    --bg2: #0a0a14;
    --bg3: #111120;
    --bg4: #1a1a2e;
    --border: rgba(255, 255, 255, 0.08);
    --border2: rgba(255, 255, 255, 0.14);
    --text: #f0f0f5;
    --text2: #9090a8;
    --accent: #5e8fff;
    --accent2: #a78bfa;
    --green: #34d399;
    --yellow: #fbbf24;
    --orange: #fb923c;
    --red: #f87171;
    --radius: 14px;
    --radius-sm: 8px;
    --sidebar-w: 220px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --gradient: linear-gradient(135deg, #5e8fff, #a78bfa);
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* ─── Auth Screen ─── */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px;
}

.auth-backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(94, 143, 255, .18) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(167, 139, 250, .12) 0%, transparent 60%);
    pointer-events: none;
}

.auth-box {
    background: rgba(10, 10, 20, 0.85);
    border: 1px solid var(--border2);
    border-radius: 24px;
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    padding: 44px 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(94,143,255,0.08), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1) both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 1.1rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent);
}

.logo-dot {
    color: var(--accent);
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
}

.auth-sub {
    color: var(--text2);
    text-align: center;
    font-size: .9rem;
    margin-top: 6px;
    margin-bottom: 24px;
}

.auth-tabs {
    display: flex;
    background: var(--bg3);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: none;
    color: var(--text2);
    font-family: var(--font);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all .2s;
}

.auth-tab.active {
    background: var(--bg4);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-row label {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text2);
}

.form-row input,
.form-row textarea,
.form-row select {
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text);
    font-family: var(--font);
    font-size: .9375rem;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    resize: none;
    appearance: none;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 143, 255, .12);
}

.form-row input::placeholder,
.form-row textarea::placeholder {
    color: rgba(255, 255, 255, .22);
}

.form-row select option {
    background: #1a1a1a;
    color: var(--text);
}

.form-row-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field-error {
    color: var(--red);
    font-size: .78rem;
}

.auth-error {
    background: rgba(248, 113, 113, .1);
    border: 1px solid rgba(248, 113, 113, .3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .875rem;
    color: var(--red);
    display: none;
}

.auth-error.visible {
    display: block;
}

.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    border: none;
    border-radius: 10px;
    padding: 13px 24px;
    color: #fff;
    font-family: var(--font);
    font-size: .9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
}

.btn-auth:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.btn-auth:active {
    transform: translateY(0);
}

.btn-auth:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.auth-switch {
    text-align: center;
    font-size: .83rem;
    color: var(--text2);
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

/* ─── Dashboard ─── */
.dashboard {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* Sidebar */
.cp-sidebar {
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.cp-brand {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.cp-brand a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
}

.cp-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    flex: 1;
}

.cp-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: var(--text2);
    font-family: var(--font);
    font-size: .875rem;
    font-weight: 500;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s;
    text-align: left;
    width: 100%;
}

.cp-nav-item:hover {
    background: var(--bg3);
    color: var(--text);
}

.cp-nav-item.active {
    background: linear-gradient(135deg, rgba(94,143,255,.15), rgba(167,139,250,.1));
    color: var(--accent);
    border: 1px solid rgba(94,143,255,.2);
    box-shadow: 0 2px 12px rgba(94,143,255,.12);
}

.cp-sidebar-footer {
    padding: 16px 12px 0;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cp-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.cp-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.cp-user-name {
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-user-email {
    font-size: .72rem;
    color: var(--text2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-signout {
    background: none;
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    flex-shrink: 0;
    transition: color .2s, background .2s;
}

.cp-signout:hover {
    color: var(--red);
    background: rgba(248, 113, 113, .08);
}

/* Main */
.cp-main {
    padding: 40px;
    overflow-y: auto;
}

.cp-section {
    display: block;
}

.cp-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 12px;
}

.cp-section-head h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.cp-section-head p {
    color: var(--text2);
    font-size: .9rem;
    margin-top: 4px;
}

.btn-new-project {
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    border: none;
    border-radius: 10px;
    padding: 11px 20px;
    color: #fff;
    font-family: var(--font);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s;
}

.btn-new-project:hover {
    opacity: .85;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: border-color .2s, transform .2s, box-shadow .2s;
    position: relative;
}

.project-card:hover {
    border-color: rgba(94, 143, 255, .4);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(94, 143, 255, .12), 0 0 0 1px rgba(94,143,255,.08);
}

.project-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}

.project-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.project-card-service {
    color: var(--text2);
    font-size: .8125rem;
    margin-top: 4px;
}

.project-card-desc {
    color: var(--text2);
    font-size: .85rem;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-card-date {
    font-size: .78rem;
    color: var(--text2);
}

.view-detail {
    font-size: .8125rem;
    color: var(--accent);
    font-weight: 500;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: .02em;
    text-transform: capitalize;
}

.status-new { background: rgba(251,191,36,.12); color: var(--yellow); border: 1px solid rgba(251,191,36,.2); }
.status-review { background: rgba(94,143,255,.12); color: var(--accent); border: 1px solid rgba(94,143,255,.2); }
.status-in_progress { background: rgba(251,146,60,.12); color: var(--orange); border: 1px solid rgba(251,146,60,.2); }
.status-completed { background: rgba(52,211,153,.12); color: var(--green); border: 1px solid rgba(52,211,153,.2); }
.status-delivered { background: rgba(167,139,250,.12); color: var(--accent2); border: 1px solid rgba(167,139,250,.2); }

/* Ticket status badges */
.status-open { background: rgba(94,143,255,.12); color: var(--accent); border: 1px solid rgba(94,143,255,.2); }
.status-pending { background: rgba(251,191,36,.12); color: var(--yellow); border: 1px solid rgba(251,191,36,.2); }
.status-resolved { background: rgba(52,211,153,.12); color: var(--green); border: 1px solid rgba(52,211,153,.2); }
.status-closed { background: rgba(255,255,255,.06); color: var(--text2); border: 1px solid var(--border); }

/* Empty State */
.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 60px 24px;
    background: var(--bg2);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text2);
    font-size: .9rem;
    max-width: 340px;
    margin: 0 auto 20px;
}

/* New Request Form */
.new-request-wrap {
    max-width: 680px;
}

.request-form {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-success {
    background: rgba(52, 211, 153, .1);
    border: 1px solid rgba(52, 211, 153, .3);
    border-radius: 8px;
    padding: 14px;
    color: var(--green);
    font-size: .9rem;
}

/* Profile Card */
.profile-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    align-items: flex-start;
    gap: 28px;
    max-width: 580px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.profile-row {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.profile-row span {
    font-size: .78rem;
    color: var(--text2);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.profile-row strong {
    font-size: .9375rem;
    font-weight: 500;
}

/* ─── Project Modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn .2s ease both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-box.large {
    background: rgba(10, 10, 20, 0.95);
    border: 1px solid var(--border2);
    border-radius: 20px;
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 100px rgba(0,0,0,.8);
    animation: modalSlide .3s cubic-bezier(0.4,0,0.2,1) both;
}

.modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 {
    font-size: 1.1rem;
    font-weight: 700;
    flex: 1;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text2);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 6px;
    transition: color .2s;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.project-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.project-detail-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-row span {
    font-size: .75rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.detail-row strong {
    font-size: .9rem;
    font-weight: 600;
}

.detail-desc {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-desc span {
    font-size: .75rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.detail-desc p {
    font-size: .9rem;
    color: var(--text2);
    line-height: 1.6;
}

/* Messages */
.project-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-messages h4 {
    font-size: .9375rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.messages-list {
    flex: 1;
    min-height: 160px;
    max-height: 280px;
    background: var(--bg3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: .85rem;
    line-height: 1.4;
    max-width: 90%;
}

.msg-bubble.client {
    background: rgba(94, 143, 255, .15);
    align-self: flex-end;
}

.msg-bubble.admin {
    background: var(--bg4);
    align-self: flex-start;
}

.msg-meta {
    font-size: .7rem;
    color: var(--text2);
    margin-top: 4px;
}

.msg-empty {
    color: var(--text2);
    font-size: .85rem;
    text-align: center;
    margin: auto;
}

.message-form {
    display: flex;
    gap: 8px;
}

.message-form input {
    flex: 1;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-family: var(--font);
    font-size: .875rem;
}

.message-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.message-form button {
    background: var(--accent);
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    color: #fff;
    font-family: var(--font);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}

.message-form button:hover {
    opacity: .85;
}

/* ─── Ticket Items ─── */
.ticket-item {
    background: rgba(255,255,255,.03);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all .3s;
    border: 1px solid var(--border);
}

.ticket-item:hover {
    background: rgba(94,143,255,.06);
    border-color: rgba(94,143,255,.2);
    transform: translateX(4px);
}

.ticket-item-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.ticket-item-meta {
    font-size: .8rem;
    color: var(--text2);
}

/* ─── Project progress bar ─── */
.project-progress-bar {
    height: 6px;
    background: rgba(255,255,255,.08);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 100px;
    transition: width .5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

    .cp-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        flex-direction: row;
        border-top: 1px solid var(--border);
        border-right: none;
        padding: 0;
        z-index: 100;
    }

    .cp-brand {
        display: none;
    }

    .cp-nav {
        flex-direction: row;
        padding: 8px;
        border-bottom: none;
    }

    .cp-nav-item {
        flex-direction: column;
        gap: 2px;
        font-size: .65rem;
        padding: 8px 6px;
    }

    .cp-sidebar-footer {
        display: none;
    }

    .cp-main {
        padding: 20px 16px 80px;
    }

    .project-detail-grid {
        grid-template-columns: 1fr;
    }

    .form-row-two {
        grid-template-columns: 1fr;
    }

    .modal-box.large {
        max-height: 95vh;
    }
}