/*
Theme Name: SS Portal
Theme URI: https://portal.supersolicitor.co.uk
Author: Big In The North Limited
Description: Solicitor portal theme for portal.supersolicitor.co.uk. Dashboard-style interface for managing firm profile, referrals, rate cards, inbox, and billing. MySQL-native. Pairs with ss-portal-core plugin.
Version: 3.3.0
Tested up to: 6.5
Requires PHP: 7.4
License: Proprietary
Text Domain: ss-portal
*/

/* =========================================================
   DESIGN TOKENS — slightly different from main site
   Portal uses a more utilitarian slate palette
   ========================================================= */
:root {
    --blue-50:  #eaf3e0;
    --blue-100: #d8e4d6;
    --blue-500: #2c5417;
    --blue-600: #0f3d2e;   /* Chancery Green — primary */
    --blue-700: #0b241b;   /* Ink Green — hover */

    --navy:    #0f3d2e;    /* sidebar / dark surfaces -> Chancery Green */
    --navy-2:  #0b241b;

    --emerald: #2c5417;
    --amber:   #e7a33c;    /* Brief Gold */
    --red:     #9c3b26;

    --slate-50:  #f5f0e6;  /* Paper Cream */
    --slate-100: #efe7d6;
    --slate-200: #cbd8cc;  /* Sage borders */
    --slate-300: #9fb6a4;
    --slate-500: #5e6f64;  /* Stone */
    --slate-600: #3a4a40;
    --slate-700: #2c3a32;
    --slate-900: #0b241b;  /* Ink Green */

    --white: #fbf9f3;      /* Cloud */

    --font-body:    'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;

    --spark-lime:      #c8f250;
    --spark-lime-deep: #b6e23c;
    --brief-gold:      #e7a33c;
    --paper-cream:     #f5f0e6;
    --ink-green:       #0b241b;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow:    0 4px 16px rgba(15, 23, 42, .08);

    --sidebar-width: 260px;
}

/* =========================================================
   BASE
   ========================================================= */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--slate-50);
    color: var(--slate-900);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); }

h1, h2, h3, h4 { font-weight: 600; color: var(--slate-900); margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

/* =========================================================
   PORTAL LAYOUT — sidebar + main
   ========================================================= */
.portal-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.portal-sidebar {
    background: var(--navy);
    color: rgba(255,255,255,.85);
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.portal-brand {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 16px;
}
.portal-brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
}
.portal-brand-firm {
    font-size: 12px;
    color: rgba(255,255,255,.5);
    margin-top: 4px;
}

.portal-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}
.portal-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: rgba(255,255,255,.75);
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.portal-nav a:hover { background: rgba(255,255,255,.05); color: var(--white); }
.portal-nav a.active {
    background: rgba(59,130,246,.15);
    color: var(--white);
    border-left-color: var(--blue-500);
}
.portal-nav-badge {
    margin-left: auto;
    background: var(--red);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.portal-sidebar-foot {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: 24px;
    font-size: 13px;
}
.portal-sidebar-foot a { color: rgba(255,255,255,.6); }
.portal-sidebar-foot a:hover { color: var(--white); }

.portal-main {
    padding: 32px 40px;
    max-width: 1200px;
    width: 100%;
}
.portal-page-head {
    margin-bottom: 24px;
}
.portal-page-head h1 { margin: 0; }
.portal-page-head p { color: var(--slate-600); margin: 4px 0 0; }

@media (max-width: 900px) {
    .portal-layout { grid-template-columns: 1fr; }
    .portal-sidebar { position: static; height: auto; }
    .portal-main { padding: 24px 20px; }
}

/* =========================================================
   CARDS
   ========================================================= */
.card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}
.card h2, .card h3 { margin-top: 0; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 20px;
}
.stat-card-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--slate-500);
    font-weight: 600;
}
.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-top: 8px;
}
.stat-card-trend { font-size: 13px; margin-top: 4px; }
.stat-card-trend.up   { color: var(--emerald); }
.stat-card-trend.down { color: var(--red); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    line-height: 1.4;
}
.btn-primary   { background: var(--blue-600); color: var(--white); }
.btn-primary:hover { background: var(--blue-700); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--slate-700); border-color: var(--slate-200); }
.btn-secondary:hover { border-color: var(--slate-300); }
.btn-danger    { background: var(--red); color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* =========================================================
   TABLES
   ========================================================= */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.table th, .table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--slate-200);
    font-size: 14px;
}
.table th {
    background: var(--slate-50);
    font-weight: 600;
    color: var(--slate-700);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--slate-50); }

/* =========================================================
   BADGES / PILLS
   ========================================================= */
.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--slate-100);
    color: var(--slate-700);
}
.pill-new     { background: #dbeafe; color: #1e40af; }
.pill-accepted{ background: #d1fae5; color: #065f46; }
.pill-closed  { background: var(--slate-100); color: var(--slate-600); }
.pill-declined{ background: #fee2e2; color: #991b1b; }

/* =========================================================
   FORMS
   ========================================================= */
.form-grid { display: grid; gap: 16px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: 6px;
}
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--slate-900);
    background: var(--white);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }

.form-msg {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}
.form-msg.success { display: block; background: #d1fae5; color: #065f46; }
.form-msg.error   { display: block; background: #fee2e2; color: #991b1b; }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
    padding: 20px;
}
.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px rgba(0,0,0,.2);
    width: 100%;
    max-width: 420px;
}
.login-card h1 { text-align: center; margin-bottom: 4px; }
.login-card p { text-align: center; color: var(--slate-600); margin-bottom: 28px; }

/* =========================================================
   REFERRAL CARD (inbox-style)
   ========================================================= */
.referral-row {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 120px 1fr 140px 120px;
    gap: 16px;
    align-items: center;
}
.referral-row:hover { border-color: var(--blue-500); }
.referral-ref { font-family: 'SF Mono', Menlo, monospace; font-size: 13px; color: var(--slate-600); }
.referral-summary { font-weight: 500; }
.referral-summary-sub { font-size: 13px; color: var(--slate-500); margin-top: 2px; }
.referral-date { font-size: 13px; color: var(--slate-500); }

@media (max-width: 800px) {
    .referral-row { grid-template-columns: 1fr; }
}

/* =========================================================
   UTIL
   ========================================================= */
.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid var(--slate-200);
    border-top-color: var(--blue-600);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: 32px; }
.text-muted { color: var(--slate-500); }

/* =========================================================
   PUBLIC / WELCOME PAGE (logged-out landing)
   ========================================================= */
.public-body { background: var(--white); }
.public-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.95); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--slate-200); }
.public-header-inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; height: 66px; display: flex; align-items: center; justify-content: space-between; }
.public-brand { font-size: 1.25rem; font-weight: 700; color: var(--slate-900); }
.public-brand:hover { color: var(--slate-900); }
.public-header .custom-logo { max-height: 40px; width: auto; }
.public-signin-link { font-weight: 600; font-size: 14.5px; }
.public-main { min-height: 60vh; }

.welcome-hero { background: radial-gradient(820px 400px at 80% -20%, rgba(59,130,246,.28), transparent 60%), var(--navy); color: #fff; }
.welcome-hero-inner { max-width: 760px; margin: 0 auto; padding: 76px 24px 64px; text-align: center; }
.welcome-eyebrow { display: inline-block; background: rgba(255,255,255,.1); color: #cbd9f5; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.welcome-hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 16px; }
.welcome-sub { color: rgba(255,255,255,.8); font-size: 1.1rem; max-width: 620px; margin: 0 auto 28px; }
.welcome-hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

.welcome-grid-wrap { background: var(--slate-50); padding: 56px 24px; }
.welcome-grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.welcome-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.welcome-card h2 { font-size: 1.3rem; margin-bottom: 8px; }
.welcome-card p { color: var(--slate-600); }
.welcome-card-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--blue-50); color: var(--blue-700); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 14px; }
.welcome-steps { color: var(--slate-700); padding-left: 20px; margin: 0 0 20px; }
.welcome-steps li { margin-bottom: 8px; }
.welcome-fineprint { font-size: 13px; color: var(--slate-500); margin-top: 14px; }

/* native wp_login_form */
#loginform { margin: 0; }
#loginform p { margin: 0 0 14px; }
#loginform label { display: block; font-size: 13px; font-weight: 600; color: var(--slate-700); margin-bottom: 6px; }
#loginform .input { width: 100%; padding: 11px 13px; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 15px; color: var(--slate-900); }
#loginform .input:focus { outline: none; border-color: var(--blue-500); }
#loginform .login-remember label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--slate-600); }
#loginform .login-remember input { width: auto; margin: 0; }
#wp-submit { width: 100%; background: var(--blue-600); color: #fff; border: none; padding: 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; cursor: pointer; }
#wp-submit:hover { background: var(--blue-700); }

.welcome-benefits { padding: 64px 24px; background: #fff; }
.welcome-benefits-inner { max-width: 1000px; margin: 0 auto; text-align: center; }
.welcome-benefits-inner > h2 { font-size: 1.5rem; margin-bottom: 36px; }
.welcome-benefits-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: left; }
.welcome-benefit { padding: 20px; border: 1px solid var(--slate-200); border-radius: var(--radius); }
.welcome-benefit h4 { font-size: 1rem; margin-bottom: 6px; }
.welcome-benefit p { color: var(--slate-600); font-size: 14px; margin: 0; }

.public-footer { background: var(--navy); color: rgba(255,255,255,.7); padding: 36px 24px; }
.public-footer-inner { max-width: 1000px; margin: 0 auto; }
.public-disclaimer { font-size: 13px; line-height: 1.6; color: rgba(255,255,255,.6); max-width: 92ch; margin: 0 0 12px; }
.public-footer a { color: #cbd9f5; }

@media (max-width: 760px) {
    .welcome-grid { grid-template-columns: 1fr; }
    .welcome-benefits-grid { grid-template-columns: 1fr; }
}


/* =========================================================
   BRAND v1.0 — portal accents on the remapped tokens
   ========================================================= */
body { background: var(--paper-cream); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }

/* Logos */
.portal-brand .brand-logo img { height: 30px; width: auto; display: block; }
.public-header .custom-logo, .public-header .public-logo img { max-height: 40px; width: auto; display: block; }
.public-logo { display: inline-flex; align-items: center; }

/* Welcome hero: green with a lime glow instead of blue */
.welcome-hero { background: radial-gradient(820px 400px at 80% -20%, rgba(200,242,80,.22), transparent 60%), var(--navy); }
.welcome-eyebrow { background: rgba(255,255,255,.10); color: #e3f0c8; }

/* Spark-lime CTA energy (claim listing + login submit) */
.welcome-hero-cta .btn-primary { background: var(--spark-lime); color: var(--ink-green); border-color: var(--spark-lime); }
.welcome-hero-cta .btn-primary:hover { background: var(--spark-lime-deep); color: var(--ink-green); }
.welcome-card-icon { background: var(--blue-50); color: var(--blue-600); }
#wp-submit { background: var(--blue-600); }
#wp-submit:hover { background: var(--blue-700); }
