/*
Theme Name:        ASTCME RTO Compliance
Theme URI:         https://astcme.com
Author:            ASTCME
Author URI:        https://astcme.com
Description:       A professional compliance-focused WordPress theme for Registered Training Organisations. Pairs with the RTO Compliance Manager plugin. Includes a custom login page, clean admin bar integration, and a minimal public front end.
Version:           1.0.0
Requires at least: 6.0
Requires PHP:      8.0
License:           GPL v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       astcme-compliance
Tags:              compliance, rto, education, professional, custom-login
*/

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  --color-primary:      #1d4ed8;
  --color-primary-dark: #1e3a8a;
  --color-accent:       #2563eb;
  --color-accent-light: #eff6ff;
  --color-success:      #059669;
  --color-warning:      #d97706;
  --color-danger:       #dc2626;
  --color-gray-50:      #f9fafb;
  --color-gray-100:     #f3f4f6;
  --color-gray-200:     #e5e7eb;
  --color-gray-300:     #d1d5db;
  --color-gray-500:     #6b7280;
  --color-gray-700:     #374151;
  --color-gray-900:     #111827;
  --color-white:        #ffffff;
  --font-sans:          'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm:          6px;
  --radius-md:          10px;
  --radius-lg:          16px;
  --shadow-sm:          0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:          0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:          0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--color-gray-900); background: var(--color-gray-50); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 800px; }

/* ── Site Header ──────────────────────────────────────────────────────────── */
#site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.admin-bar #site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar #site-header { top: 46px; } }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.site-logo__icon {
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.site-logo__icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-logo__text { display: flex; flex-direction: column; }
.site-logo__name { font-size: 0.9rem; font-weight: 700; color: var(--color-gray-900); line-height: 1.2; }
.site-logo__sub  { font-size: 0.7rem; color: var(--color-gray-500); line-height: 1; }

.header-nav { display: flex; align-items: center; gap: 0.25rem; }
.header-nav a {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700);
  transition: background 0.15s, color 0.15s;
}
.header-nav a:hover { background: var(--color-gray-100); color: var(--color-gray-900); text-decoration: none; }
.header-nav a.current { background: var(--color-accent-light); color: var(--color-accent); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; color: var(--color-primary); border: 1.5px solid var(--color-primary); }
.btn-outline:hover { background: var(--color-accent-light); text-decoration: none; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* ── Mobile nav toggle ────────────────────────────────────────────────────── */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.4rem; border-radius: var(--radius-sm); }
.nav-toggle:hover { background: var(--color-gray-100); }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--color-gray-700); margin: 4px 0; transition: all 0.2s; }
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .header-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--color-gray-200); flex-direction: column; padding: 0.75rem; gap: 0.25rem; box-shadow: var(--shadow-md); }
  .header-nav.open { display: flex; }
  .admin-bar .header-nav { top: 96px; }
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 60%, #3b82f6 100%);
  color: #fff;
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.page-hero__content { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 800; margin-bottom: 0.75rem; line-height: 1.2; }
.page-hero p  { font-size: 1.1rem; opacity: 0.85; max-width: 560px; }
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; opacity: 0.7; margin-bottom: 1rem; }
.breadcrumb a { color: #fff; }
.breadcrumb-sep { opacity: 0.5; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-body { padding: 1.5rem; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--color-gray-100); }

/* ── Compliance Access page ───────────────────────────────────────────────── */
.access-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-accent-light) 100%);
}
.access-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
}
.access-card__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  text-align: center;
}
.access-card__icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}
.access-card__icon svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.access-card__title { font-size: 1.25rem; font-weight: 700; color: var(--color-gray-900); }
.access-card__sub   { font-size: 0.85rem; color: var(--color-gray-500); }

/* ── Custom Login Page ────────────────────────────────────────────────────── */
body.login {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 60%, #3b82f6 100%) !important;
  font-family: var(--font-sans) !important;
}
body.login #login {
  width: 100%;
  max-width: 400px;
  padding: 0;
}
body.login #login h1 a {
  background-image: none !important;
  background-color: transparent !important;
  width: auto !important;
  height: auto !important;
  display: block;
  text-align: center;
  margin-bottom: 0.5rem;
}
body.login #login h1 a::before {
  content: '';
  display: inline-block;
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.2);
  border-radius: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px;
}
#login_error, .message, .success {
  border-radius: var(--radius-md) !important;
  border-left: none !important;
  font-family: var(--font-sans) !important;
  font-size: 0.875rem !important;
}
#loginform, #lostpasswordform {
  background: var(--color-white) !important;
  border-radius: var(--radius-lg) !important;
  border: none !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 2rem !important;
  margin-top: 1rem !important;
}
#loginform label, #lostpasswordform label {
  font-family: var(--font-sans) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--color-gray-700) !important;
}
#loginform input[type="text"],
#loginform input[type="password"],
#loginform input[type="email"],
#lostpasswordform input[type="text"] {
  font-family: var(--font-sans) !important;
  border: 1.5px solid var(--color-gray-300) !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.6rem 0.85rem !important;
  font-size: 0.9rem !important;
  width: 100% !important;
  box-shadow: none !important;
  transition: border-color 0.15s !important;
}
#loginform input[type="text"]:focus,
#loginform input[type="password"]:focus,
#lostpasswordform input[type="text"]:focus {
  border-color: var(--color-accent) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important;
}
#wp-submit {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  padding: 0.6rem 1.5rem !important;
  width: 100% !important;
  transition: background 0.15s !important;
}
#wp-submit:hover { background: var(--color-primary-dark) !important; border-color: var(--color-primary-dark) !important; }
#nav, #backtoblog { text-align: center; }
#nav a, #backtoblog a { color: rgba(255,255,255,0.8) !important; font-family: var(--font-sans) !important; font-size: 0.8rem !important; }
#nav a:hover, #backtoblog a:hover { color: #fff !important; }
.login-title-text {
  text-align: center;
  color: #fff;
  font-family: var(--font-sans);
  margin-bottom: 0.25rem;
}
.login-title-text h2 { font-size: 1.4rem; font-weight: 700; }
.login-title-text p  { font-size: 0.85rem; opacity: 0.75; }

/* ── Compliance Portal page ───────────────────────────────────────────────── */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.portal-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gray-200);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}
.portal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.portal-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.portal-card__icon svg { width: 22px; height: 22px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.portal-card__title { font-weight: 700; font-size: 1rem; color: var(--color-gray-900); }
.portal-card__desc  { font-size: 0.85rem; color: var(--color-gray-500); line-height: 1.5; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
#site-footer {
  background: var(--color-gray-900);
  color: var(--color-gray-300);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand__name { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.footer-brand__desc { font-size: 0.85rem; line-height: 1.6; color: var(--color-gray-500); }
.footer-col h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-gray-500); margin-bottom: 0.75rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.footer-col ul a { font-size: 0.875rem; color: var(--color-gray-400); transition: color 0.15s; }
.footer-col ul a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; font-size: 0.8rem; color: var(--color-gray-500); }

/* ── Content area ─────────────────────────────────────────────────────────── */
.site-main { flex: 1; padding: 3rem 0; }
.entry-content { max-width: 760px; }
.entry-content h1, .entry-content h2, .entry-content h3 { color: var(--color-gray-900); font-weight: 700; margin-bottom: 0.75rem; margin-top: 1.5rem; }
.entry-content p { margin-bottom: 1rem; color: var(--color-gray-700); line-height: 1.7; }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.entry-content li { margin-bottom: 0.4rem; color: var(--color-gray-700); }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; align-items: center; }
.gap-2 { gap: 0.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
