/* =====================================================
   Quiz Access Manager – Frontend Styles
   ===================================================== */

/* --- Buttons --- */
.qam-btn {
    display: inline-block;
    padding: 10px 22px;
    background: #2563eb;
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.qam-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}
.qam-btn--outline {
    background: transparent;
    color: #2563eb !important;
    border-color: #2563eb;
}
.qam-btn--outline:hover { background: #eff6ff; }
.qam-btn--danger {
    background: #dc2626;
}
.qam-btn--danger:hover { background: #b91c1c; }

/* --- Badges --- */
.qam-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.qam-badge--free { background: #dcfce7; color: #15803d; }
.qam-badge--paid { background: #fef3c7; color: #92400e; }

/* --- Dashboard --- */
.qam-dashboard { max-width: 860px; }
.qam-dashboard__section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 24px;
}
.qam-dashboard__section h2 {
    margin-top: 0;
    font-size: 18px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

/* --- Subscription Status --- */
.qam-subscription { padding: 4px 0; }
.qam-subscription__plan,
.qam-subscription__expiry { margin-bottom: 10px; font-size: 15px; }
.qam-subscription__plan .qam-label,
.qam-subscription__expiry .qam-label { color: #6b7280; margin-right: 6px; }
.qam-subscription__actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.qam-subscription--expired,
.qam-subscription--none { color: #6b7280; }

/* --- Table --- */
.qam-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.qam-table th,
.qam-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
}
.qam-table thead th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}
.qam-pass { color: #15803d; font-weight: 600; }
.qam-fail { color: #dc2626; font-weight: 600; }

/* --- Courses Grid --- */
.qam-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.qam-course-card {
    display: block;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.qam-course-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #93c5fd;
}
.qam-course-card__title { font-weight: 600; margin-bottom: 12px; color: #111827; }
.qam-progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}
.qam-progress-bar__fill {
    height: 100%;
    background: #2563eb;
    border-radius: 999px;
    transition: width 0.4s;
}
.qam-course-card span { font-size: 12px; color: #6b7280; }

/* --- Subscription Plans Grid --- */
.qam-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}
.qam-plan-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.qam-plan-card:hover {
    border-color: #2563eb;
    box-shadow: 0 6px 20px rgba(37,99,235,0.12);
}
.qam-plan-name { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.qam-plan-price { font-size: 32px; font-weight: 800; color: #2563eb; margin-bottom: 4px; }
.qam-plan-duration { color: #6b7280; font-size: 14px; margin-bottom: 20px; }
.qam-plan-btn {
    display: block;
    padding: 10px 0;
    background: #2563eb;
    color: #fff !important;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.qam-plan-btn:hover { background: #1d4ed8; }

/* --- Notices --- */
.qam-notice {
    padding: 14px 18px;
    border-left: 4px solid #2563eb;
    background: #eff6ff;
    border-radius: 0 6px 6px 0;
    color: #1e3a8a;
}
.qam-empty { color: #9ca3af; font-style: italic; }


/* =====================================================================
   Quiz Access Manager – Login / Register Pages  (v2)
   Colours are set via CSS variables injected inline from admin settings.
   ===================================================================== */

:root {
    --qam-primary: #1a3d7c;
    --qam-accent:  #4A90D9;
    --qam-circle:  #d9e8f5;
    --qam-shadow:  0 8px 40px rgba(26,61,124,0.12);
    --qam-radius:  12px;
}

/* ── Layout ────────────────────────────────────────────────────────── */
.qam-auth-wrap {
    display: flex;
    align-items: center;
    max-width: 1050px;
    margin: 0 auto;
    padding: 24px 16px;
    gap: 0;
}
.qam-auth-wrap--no-image { justify-content: center; }

/* ── Left panel: photo ─────────────────────────────────────────────── */
.qam-auth-image {
    flex: 0 0 42%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 480px;
}
.qam-auth-image img {
    position: relative;
    z-index: 2;
    max-width: 310px;
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.qam-auth-circle {
    position: absolute;
    border-radius: 50%;
    background: var(--qam-circle);
    opacity: .75;
    pointer-events: none;
}
.qam-auth-circle--lg { width: 290px; height: 290px; bottom: 30px; right: 14px; }
.qam-auth-circle--sm { width: 150px; height: 150px; top: 36px;   left: 6px;   }

/* ── Right panel: card ─────────────────────────────────────────────── */
.qam-auth-card {
    flex: 1;
    background: #fff;
    border-radius: var(--qam-radius);
    box-shadow: var(--qam-shadow);
    padding: 38px 44px;
    max-width: 490px;
}
.qam-auth-wrap--no-image .qam-auth-card { max-width: 440px; }

/* Head */
.qam-auth-title {
    font-size: 21px;
    font-weight: 700;
    color: #1a2236;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.3;
}
.qam-auth-badge-start {
    font-size: 11px;
    font-weight: 700;
    background: #f1f3f5;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    padding: 2px 7px;
    color: #6b7280;
    white-space: nowrap;
}
.qam-auth-sub {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 22px;
}

/* Message box */
.qam-auth-msg {
    padding: 11px 15px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
    border-left: 4px solid;
}
.qam-auth-msg--success { background: #f0faf4; border-color: #16a34a; color: #14532d; }
.qam-auth-msg--error   { background: #fdf2f2; border-color: #dc2626; color: #7f1d1d; }

/* Fields */
.qam-auth-field {
    position: relative;
    margin-bottom: 12px;
}
.qam-auth-field__ico {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: .45;
    pointer-events: none;
}
.qam-auth-field input[type="email"],
.qam-auth-field input[type="password"],
.qam-auth-field input[type="text"] {
    width: 100%;
    padding: 12px 13px 12px 40px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 14px;
    color: #1a2236;
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s;
}
.qam-auth-field input:focus {
    border-color: var(--qam-accent);
    background: #fff;
}
.qam-toggle-pw {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: .45;
    padding: 0;
    line-height: 1;
}

/* Two-column row (first / last name) */
.qam-auth-row2 { display: flex; gap: 10px; }
.qam-auth-row2 .qam-auth-field { flex: 1; }
.qam-auth-row2 input { padding-left: 13px !important; }

/* Meta row */
.qam-auth-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 13px;
}
.qam-auth-check {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6b7280;
    cursor: pointer;
}

/* ── Auth buttons ─────────────────────────────────────────────────── */
.qam-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all .2s;
    box-sizing: border-box;
    margin-bottom: 9px;
}
.qam-auth-btn--primary {
    background: var(--qam-primary);
    color: #fff !important;
    border-color: var(--qam-primary);
}
.qam-auth-btn--primary:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26,61,124,.3);
}
.qam-auth-btn--google   { background:#fff; color:#ea4335!important; border-color:#ea4335; }
.qam-auth-btn--facebook { background:#fff; color:#1877F2!important; border-color:#1877F2; }
.qam-auth-btn--apple    { background:#fff; color:#000!important;    border-color:#000; }
.qam-auth-btn--google:hover   { background:#fff5f5; }
.qam-auth-btn--facebook:hover { background:#f0f7ff; }
.qam-auth-btn--apple:hover    { background:#f5f5f5; }
.qam-auth-btn img { width: 18px; height: 18px; }

/* Divider */
.qam-auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 13px;
    color: #d1d5db;
    font-size: 13px;
}
.qam-auth-divider::before,
.qam-auth-divider::after { content:''; flex:1; height:1px; background:#e5e7eb; }

/* Links */
.qam-auth-link           { color: var(--qam-accent); text-decoration: none; font-size: 13px; }
.qam-auth-link:hover     { text-decoration: underline; }
.qam-auth-link--bold     { font-weight: 700; }

/* Terms */
.qam-auth-terms {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin: 6px 0 0;
    line-height: 1.5;
}

/* Card footer */
.qam-auth-card__foot {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .qam-auth-image { display: none; }
    .qam-auth-card  { max-width: 100%; }
    .qam-auth-wrap  { justify-content: center; }
}
@media (max-width: 520px) {
    .qam-auth-card  { padding: 26px 18px; }
    .qam-auth-row2  { flex-direction: column; gap: 0; }
}
