/* ============================================================
   PeopleWorks Meeting — Portal styles (W3)
   Shared by login.html, register.html, dashboard.html.
   Token system mirrors web/index.html and the mobile Hearica palette.
   ============================================================ */

:root {
    --pw-teal:        #0d9488;
    --pw-teal-deep:   #0F766E;
    --pw-teal-bright: #14B8A6;
    --pw-teal-soft:   #5EEAD4;
    --pw-ink:         #0F172A;
    --pw-deep:        #134E4A;
    --pw-canvas:      #F8FAFC;
    --pw-surface:     #FFFFFF;
    --pw-text:        #1F2937;
    --pw-text-muted:  #6B7280;
    --pw-border:      #E5E7EB;
    --pw-error:       #DC2626;
    --pw-error-bg:    #FEF2F2;
    --pw-success:     #16A34A;
    --pw-success-bg:  #F0FDF4;

    --pw-radius-sm:   8px;
    --pw-radius-md:   12px;
    --pw-radius-lg:   16px;

    --pw-shadow-sm:   0 1px 3px rgba(15, 23, 42, 0.06);
    --pw-shadow-md:   0 4px 16px rgba(15, 23, 42, 0.08);
    --pw-shadow-lg:   0 24px 80px rgba(15, 23, 42, 0.18);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--pw-text);
    background: linear-gradient(135deg, #0F172A 0%, #134E4A 50%, #0F766E 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sora', 'Inter', -apple-system, sans-serif;
    color: var(--pw-text);
    letter-spacing: -0.01em;
}

a { color: var(--pw-teal-deep); text-decoration: none; }
a:hover { color: var(--pw-teal); text-decoration: underline; }

/* ============ Auth shell (login + register) ============ */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--pw-surface);
    border-radius: var(--pw-radius-lg);
    box-shadow: var(--pw-shadow-lg);
    overflow: hidden;
    animation: auth-fade-in 0.4s ease;
}

@keyframes auth-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-card__header {
    background: linear-gradient(135deg, var(--pw-teal-deep), var(--pw-teal));
    padding: 28px 32px;
    color: white;
}

.auth-card__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: white;
    text-decoration: none;
}
.auth-card__brand:hover { color: white; text-decoration: none; opacity: 0.9; }

.auth-card__brand-mark {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.18);
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 900;
}

.auth-card__title {
    font-size: 24px;
    font-weight: 800;
    color: white;
    margin: 0 0 4px 0;
}

.auth-card__subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
}

.auth-card__body { padding: 28px 32px 32px; }

/* ============ Form fields ============ */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--pw-text);
}

.field input {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--pw-radius-md);
    border: 1px solid var(--pw-border);
    background: var(--pw-surface);
    color: var(--pw-text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
    border-color: var(--pw-teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.field input:disabled {
    background: var(--pw-canvas);
    color: var(--pw-text-muted);
    cursor: not-allowed;
}

.field__hint {
    font-size: 12px;
    color: var(--pw-text-muted);
}

/* ============ Buttons ============ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--pw-radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn--primary {
    background: linear-gradient(135deg, var(--pw-teal-deep), var(--pw-teal));
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}
.btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.32);
}

.btn--block { width: 100%; }

.btn__spinner {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ============ Alerts ============ */

.alert {
    padding: 11px 14px;
    border-radius: var(--pw-radius-md);
    font-size: 14px;
    margin-bottom: 14px;
    display: flex; align-items: flex-start; gap: 8px;
    line-height: 1.45;
}
.alert--error   { background: var(--pw-error-bg);   color: var(--pw-error);   border: 1px solid #FCA5A5; }
.alert--success { background: var(--pw-success-bg); color: var(--pw-success); border: 1px solid #86EFAC; }

.alert__icon {
    flex-shrink: 0;
    width: 18px; height: 18px;
    margin-top: 2px;
}

/* ============ Divider + footer ============ */

.auth-divider {
    margin: 18px 0;
    text-align: center;
    color: var(--pw-text-muted);
    font-size: 13px;
    position: relative;
}
.auth-divider::before, .auth-divider::after {
    content: "";
    position: absolute;
    top: 50%; width: calc(50% - 24px);
    height: 1px; background: var(--pw-border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-footer {
    text-align: center;
    font-size: 14px;
    color: var(--pw-text-muted);
}
.auth-footer a {
    color: var(--pw-teal-deep);
    font-weight: 600;
}

/* ============ Dashboard shell ============ */

body.dash {
    background: var(--pw-canvas);
    min-height: 100vh;
}

.dash-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 64px 1fr;
    grid-template-areas:
        "topbar topbar"
        "sidebar main";
    min-height: 100vh;
}

.dash-topbar {
    grid-area: topbar;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    background: var(--pw-surface);
    border-bottom: 1px solid var(--pw-border);
    box-shadow: var(--pw-shadow-sm);
    position: sticky; top: 0; z-index: 10;
}

.dash-brand {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: 'Sora', sans-serif;
    font-weight: 800; font-size: 16px;
    color: var(--pw-text); text-decoration: none;
}
.dash-brand:hover { text-decoration: none; }
.dash-brand__mark {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--pw-teal-deep), var(--pw-teal));
    color: white;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 12px;
}
.dash-brand__product { color: var(--pw-teal-deep); font-weight: 700; }

.dash-user {
    display: inline-flex; align-items: center; gap: 12px;
    font-size: 14px;
}
.dash-user__avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pw-teal-deep), var(--pw-teal));
    color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.dash-user__name { color: var(--pw-text); font-weight: 600; }
.dash-user__email { color: var(--pw-text-muted); font-size: 12px; }

.dash-signout {
    background: transparent;
    border: 1px solid var(--pw-border);
    color: var(--pw-text);
    padding: 7px 14px;
    border-radius: var(--pw-radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.dash-signout:hover { background: var(--pw-canvas); border-color: var(--pw-teal); color: var(--pw-teal-deep); }

.dash-sidebar {
    grid-area: sidebar;
    background: var(--pw-surface);
    border-right: 1px solid var(--pw-border);
    padding: 20px 12px;
    display: flex; flex-direction: column; gap: 4px;
}

.dash-sidebar__label {
    font-size: 11px;
    font-weight: 700;
    color: var(--pw-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 12px 4px;
}

.dash-nav {
    background: transparent;
    border: none;
    padding: 9px 12px;
    border-radius: var(--pw-radius-md);
    font-family: inherit;
    font-size: 14px;
    color: var(--pw-text);
    cursor: pointer;
    text-align: left;
    display: flex; align-items: center; gap: 10px;
    transition: background 0.12s ease, color 0.12s ease;
}
.dash-nav:hover { background: var(--pw-canvas); }
.dash-nav--active {
    background: rgba(13, 148, 136, 0.08);
    color: var(--pw-teal-deep);
    font-weight: 600;
}
.dash-nav__count {
    margin-left: auto;
    font-size: 12px;
    color: var(--pw-text-muted);
    background: var(--pw-canvas);
    padding: 1px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.dash-nav--active .dash-nav__count { background: var(--pw-teal); color: white; }

.dash-main {
    grid-area: main;
    padding: 28px 32px;
    overflow-y: auto;
}

.dash-page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    margin-bottom: 20px;
}
.dash-page-head h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
}
.dash-page-head__sub {
    font-size: 14px;
    color: var(--pw-text-muted);
    margin-top: 4px;
}

.dash-list {
    display: flex; flex-direction: column; gap: 10px;
}

.dash-item {
    background: var(--pw-surface);
    border: 1px solid var(--pw-border);
    border-radius: var(--pw-radius-md);
    padding: 14px 18px;
    display: flex; flex-direction: column; gap: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dash-item:hover {
    border-color: var(--pw-teal);
    box-shadow: var(--pw-shadow-md);
}
.dash-item__top {
    display: flex; align-items: center; gap: 10px;
}
.dash-item__title {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: var(--pw-text);
    margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-item__meta {
    display: flex; gap: 14px; flex-wrap: wrap;
    font-size: 13px;
    color: var(--pw-text-muted);
}
.dash-item__preview {
    margin: 0;
    font-size: 13px;
    color: var(--pw-text-muted);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--pw-canvas);
    color: var(--pw-text-muted);
    border: 1px solid var(--pw-border);
}
.tag--teal {
    background: rgba(13, 148, 136, 0.1);
    color: var(--pw-teal-deep);
    border-color: transparent;
}
.tag--project {
    background: rgba(15, 118, 110, 0.08);
    color: var(--pw-teal-deep);
    border-color: rgba(15, 118, 110, 0.2);
    font-weight: 700;
}

.dash-empty {
    background: var(--pw-surface);
    border: 1px dashed var(--pw-border);
    border-radius: var(--pw-radius-md);
    padding: 60px 24px;
    text-align: center;
}
.dash-empty__icon {
    width: 48px; height: 48px;
    color: var(--pw-text-muted);
    margin-bottom: 12px;
}
.dash-empty h3 {
    font-size: 18px;
    margin: 0 0 6px;
    color: var(--pw-text);
}
.dash-empty p {
    color: var(--pw-text-muted);
    font-size: 14px;
    max-width: 460px;
    margin: 0 auto;
    line-height: 1.5;
}

.skeleton-row {
    background: var(--pw-surface);
    border: 1px solid var(--pw-border);
    border-radius: var(--pw-radius-md);
    padding: 16px 18px;
    display: flex; flex-direction: column; gap: 8px;
}
.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #F3F4F6 0%, #E5E7EB 50%, #F3F4F6 100%);
    background-size: 200% 100%;
    animation: skel 1.4s linear infinite;
    border-radius: 4px;
}
@keyframes skel {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.btn--secondary {
    background: var(--pw-surface);
    border: 1px solid var(--pw-border);
    color: var(--pw-text);
}
.btn--secondary:hover:not(:disabled) {
    border-color: var(--pw-teal);
    color: var(--pw-teal-deep);
}

@media (max-width: 768px) {
    .dash-shell {
        grid-template-columns: 1fr;
        grid-template-areas: "topbar" "main";
    }
    .dash-sidebar { display: none; }
    .dash-main { padding: 18px 16px; }
}
