@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
    --agency-accent: #ff6b35;
    --agency-accent-hover: #e85d04;
    --agency-accent-rgb: 255, 107, 53;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #c9c9c9;
    background: #0d0d0d;
    min-height: 100vh;
    position: relative;
}

/* Campfire background image */
.campfire-bg {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(500px, 90vw);
    height: min(500px, 90vw);
    z-index: 0;
    opacity: 0.6;
    filter: blur(10px);
    pointer-events: none;
}

.campfire-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
}

/* Campfire on both sides (all pages except home) */
body:not(.home-page) .campfire-bg-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 0;
    pointer-events: none;
}

body:not(.home-page) .campfire-bg-wrapper .campfire-bg {
    position: absolute;
    bottom: 0;
    left: auto;
    right: auto;
    transform: none;
    width: min(350px, 35vw);
    height: min(350px, 35vw);
}

body:not(.home-page) .campfire-bg-wrapper .campfire-bg-left {
    left: 0;
}

body:not(.home-page) .campfire-bg-wrapper .campfire-bg-right {
    right: 0;
    transform: scaleX(-1);
}


header {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.92) 0%, rgba(13, 13, 13, 0.92) 100%);
    border-bottom: 3px solid #2d2d2d;
    color: #e8e8e8;
    text-align: center;
    padding: 2rem 2rem 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    background: transparent;
    border-radius: 50%;
}

header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #e8e8e8;
    letter-spacing: 0.05em;
}

.tagline {
    font-size: 1rem;
    color: #8b8b8b;
    margin-bottom: 0;
}

/* Daily Tips carousel */
.daily-tips-container {
    margin-bottom: 0.5rem;
}

.daily-tips-header {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--agency-accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.daily-tips-carousel {
    position: relative;
    min-height: 3rem;
}

.daily-tips-carousel .daily-tip {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    font-size: 1rem;
    color: #8b8b8b;
    margin: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.daily-tips-carousel .daily-tip.active {
    position: relative;
    opacity: 1;
    pointer-events: auto;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: #a0a0a0;
    text-decoration: none;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: 1px solid #3d3d3d;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.main-nav a:hover {
    color: var(--agency-accent);
    border-color: var(--agency-accent-hover);
    background: rgba(var(--agency-accent-rgb), 0.1);
    box-shadow: 0 0 15px rgba(var(--agency-accent-rgb), 0.2);
}

.main-nav a.active {
    color: var(--agency-accent);
    border-color: var(--agency-accent-hover);
    background: rgba(var(--agency-accent-rgb), 0.15);
}

.main-nav a.nav-current {
    display: none;
}

/* Hide nav on home page – course cards replace it */
.home-page .main-nav {
    display: none;
}

/* Course cards (home page) */
.course-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.course-card {
    display: block;
    padding: 1.5rem;
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.9) 0%, rgba(20, 20, 20, 0.9) 100%);
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.course-card:hover {
    border-color: var(--agency-accent-hover);
    box-shadow: 0 0 20px rgba(var(--agency-accent-rgb), 0.25);
    transform: translateY(-2px);
}

.course-card h3 {
    font-family: 'Cinzel', serif;
    color: var(--agency-accent);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

.course-card p {
    color: #a0a0a0;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.course-card-cta {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--agency-accent);
}

.course-card:hover .course-card-cta {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .course-cards {
        grid-template-columns: 1fr;
    }
}

/* Progress dashboard */
.progress-dashboard {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.progress-dashboard h2 {
    font-family: 'Cinzel', serif;
    color: var(--agency-accent);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.9) 0%, rgba(20, 20, 20, 0.9) 100%);
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.progress-item:hover {
    border-color: var(--agency-accent-hover);
    box-shadow: 0 0 15px rgba(var(--agency-accent-rgb), 0.2);
}

.progress-label {
    font-weight: 600;
    color: #e8e8e8;
    font-size: 1rem;
}

.progress-status {
    font-size: 0.9rem;
    color: #8b8b8b;
}

.progress-item.progress-started .progress-status {
    color: #6b9b6b;
}

.progress-item.progress-not-started .progress-status {
    color: #5a5a5a;
    font-style: italic;
}

.progress-login-hint {
    color: #8b8b8b;
    font-size: 0.95rem;
}

@media (max-width: 500px) {
    .progress-grid {
        grid-template-columns: 1fr;
    }
}

main {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

section {
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.9) 0%, rgba(20, 20, 20, 0.9) 100%);
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

section h2 {
    font-family: 'Cinzel', serif;
    color: var(--agency-accent);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
}

section p {
    color: #a0a0a0;
}

footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    color: #5a5a5a;
    font-size: 0.9rem;
    border-top: 1px solid #2d2d2d;
}

/* Goals section */
.goals-container {
    max-width: 600px;
    margin: 0 auto;
}

.welcome-box {
    margin-top: 2rem;
}

.welcome-box h2 {
    margin-bottom: 0.75rem;
}

.goals-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #e8e8e8;
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.9) 0%, rgba(20, 20, 20, 0.9) 100%);
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.goals-btn:hover {
    border-color: var(--agency-accent-hover);
    color: var(--agency-accent);
    box-shadow: 0 0 15px rgba(var(--agency-accent-rgb), 0.2);
}

.goals-btn[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.goals-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: linear-gradient(145deg, #141414 0%, #1a1a1a 100%);
    border: 1px solid #2d2d2d;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.goals-panel.open {
    max-height: 500px;
}

.goals-add {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #2d2d2d;
}

.goals-add input {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    color: #e8e8e8;
    background: #0d0d0d;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
}

.goals-add input::placeholder {
    color: #5a5a5a;
}

.goals-add input:focus {
    outline: none;
    border-color: var(--agency-accent-hover);
}

.add-goal-btn {
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    color: #0d0d0d;
    background: var(--agency-accent);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-goal-btn:hover {
    background: var(--agency-accent-hover);
}

.goals-list {
    list-style: none;
    padding: 1rem 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.goals-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #2d2d2d;
    color: #c9c9c9;
}

.goals-list li:last-child {
    border-bottom: none;
}

.goals-list .goal-text {
    flex: 1;
}

.goals-list .remove-goal {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    color: #8b8b8b;
    background: transparent;
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.goals-list .remove-goal:hover {
    color: var(--agency-accent);
    border-color: var(--agency-accent-hover);
}

.goals-list:empty::before {
    content: "No goals yet. Add one above!";
    display: block;
    color: #5a5a5a;
    font-style: italic;
    padding: 0.5rem 0;
}

/* Auth / Login page */
.auth-page {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    text-align: center;
    background: rgba(13, 13, 13, 0.9);
    border-radius: 12px;
    border: 1px solid #2d2d2d;
}

.auth-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 1rem;
    background: transparent;
    border-radius: 50%;
}

.auth-container h1 {
    font-family: 'Cinzel', serif;
    color: #e8e8e8;
    margin-bottom: 0.5rem;
}

.auth-tagline {
    color: #8b8b8b;
    margin-bottom: 1.5rem;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    font-weight: 600;
    color: #8b8b8b;
    background: #1a1a1a;
    border: 1px solid #2d2d2d;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab:first-child {
    border-radius: 6px 0 0 6px;
}

.auth-tab:last-child {
    border-radius: 0 6px 6px 0;
}

.auth-tab.active {
    color: var(--agency-accent);
    background: rgba(var(--agency-accent-rgb), 0.15);
    border-color: var(--agency-accent-hover);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hidden {
    display: none !important;
}

#appView {
    position: relative;
    z-index: 1;
}

#appView.hidden {
    display: none !important;
}

#authView.auth-page {
    display: flex;
}

#authView.auth-page.hidden {
    display: none !important;
}

.auth-form.hidden {
    display: none;
}

.auth-link {
    color: var(--agency-accent);
    text-decoration: underline;
    display: inline-block;
    margin-top: 0.5rem;
}

.auth-link:hover {
    color: var(--agency-accent-hover);
}

.auth-form input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: #e8e8e8;
    background: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--agency-accent-hover);
}

.auth-form select {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: #e8e8e8;
    background: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    cursor: pointer;
}

.auth-form input[readonly] {
    opacity: 0.8;
    cursor: default;
}

.auth-submit {
    padding: 0.75rem;
    font-weight: 600;
    color: #0d0d0d;
    background: var(--agency-accent);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-submit:hover {
    background: var(--agency-accent-hover);
}

.auth-error {
    color: var(--agency-accent);
    font-size: 0.9rem;
    margin: 0;
}

.auth-error .invalid-main {
    margin-bottom: 0.5rem;
}

.auth-error .error-detail {
    background: rgba(var(--agency-accent-rgb), 0.1);
    padding: 0.75rem;
    border-radius: 6px;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.auth-error .invalid-hint {
    color: #8b8b8b;
    font-size: 0.85rem;
    margin: 0.75rem 0 0.5rem;
}

.auth-error code {
    background: #1a1a1a;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.auth-error .debug-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #1a1a1a;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #8b8b8b;
    word-break: break-all;
}

.manual-token {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.manual-token input {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    color: #e8e8e8;
    background: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
}

.manual-token .auth-submit {
    align-self: flex-start;
}

.auth-hint {
    color: #5a5a5a;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* User profile in header - top left */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.user-name {
    color: #8b8b8b;
    font-size: 0.9rem;
}

.edit-name-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    color: #8b8b8b;
    background: transparent;
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-name-btn:hover {
    color: var(--agency-accent);
    border-color: var(--agency-accent);
}

.edit-name-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    z-index: 10;
}

.edit-name-panel input {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #e8e8e8;
    background: #0d0d0d;
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    min-width: 150px;
}

.save-name-btn,
.cancel-edit-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
}

.save-name-btn {
    background: var(--agency-accent);
    color: #0d0d0d;
    border: none;
}

.cancel-edit-btn {
    background: transparent;
    color: #8b8b8b;
    border: 1px solid #3d3d3d;
}

.user-info-wrap {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.logout-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--agency-accent);
    background: transparent;
    border: 1px solid var(--agency-accent-hover);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(var(--agency-accent-rgb), 0.15);
}

/* Admin panel */
.admin-section {
    margin-bottom: 2rem;
}

.admin-desc {
    margin-bottom: 1.5rem;
}

.admin-invite-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.admin-invite-form input {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    color: #e8e8e8;
    background: #0d0d0d;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
}

.admin-invite-form input:focus {
    outline: none;
    border-color: var(--agency-accent-hover);
}

.invite-result {
    background: #1a1a1a;
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.invite-result p {
    margin-bottom: 0.5rem;
}

.invite-link-label {
    font-size: 0.9rem;
    color: #8b8b8b;
    margin-top: 0.75rem;
}

.invite-link-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.invite-link-box code {
    flex: 1;
    padding: 0.5rem;
    background: #0d0d0d;
    border-radius: 4px;
    font-size: 0.85rem;
    word-break: break-all;
}

.copy-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--agency-accent);
    background: transparent;
    border: 1px solid var(--agency-accent-hover);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.copy-btn:hover {
    background: rgba(var(--agency-accent-rgb), 0.15);
}

.invite-email-btn {
    display: inline-block;
    margin-top: 0.5rem;
    text-decoration: none;
}

.invite-instructions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #2d2d2d;
}

.invite-instructions h3 {
    font-family: 'Cinzel', serif;
    color: #e8e8e8;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.invite-instructions ol {
    margin-left: 1.25rem;
    color: #a0a0a0;
    font-size: 0.95rem;
}

.invite-instructions li {
    margin-bottom: 0.5rem;
}

.invites-list {
    list-style: none;
}

.invites-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #2d2d2d;
    color: #c9c9c9;
}

.invites-empty {
    color: #5a5a5a;
    font-style: italic;
}

.invite-date {
    color: #5a5a5a;
    font-size: 0.9rem;
}

/* Sales Psychology phases & modules */
.phase-main {
    max-width: 800px;
}

.page-title {
    font-family: 'Cinzel', serif;
    color: var(--agency-accent);
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.page-intro {
    color: #8b8b8b;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.rebuttal-section {
    background: linear-gradient(145deg, #1a1a1a 0%, #141414 100%);
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.rebuttal-unit-title {
    font-family: 'Cinzel', serif;
    color: var(--agency-accent);
    font-size: 1.15rem;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.rebuttal-section .phase-content {
    padding: 0;
}

.rebuttal-response {
    font-style: italic;
    color: #c9c9c9;
    border-left: 3px solid var(--agency-accent);
    padding-left: 1rem;
    margin: 0;
}

.rebuttal-note {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #2d2d2d;
    color: #8b8b8b;
    font-size: 0.9rem;
}

/* Add rebuttal button and row */
.add-rebuttal-row {
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(145deg, #1a1a1a 0%, #141414 100%);
    border: 1px dashed #3d3d3d;
    border-radius: 8px;
}

.add-rebuttal-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--agency-accent);
    background: transparent;
    border: 2px solid var(--agency-accent);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.add-rebuttal-btn:hover {
    background: rgba(var(--agency-accent-rgb), 0.15);
    box-shadow: 0 0 15px rgba(var(--agency-accent-rgb), 0.3);
}

.add-rebuttal-hint {
    margin-top: 0.5rem;
    color: #8b8b8b;
    font-size: 0.9rem;
}

/* Custom rebuttals section */
.custom-rebuttals-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #2d2d2d;
}

.custom-rebuttals-title {
    font-family: 'Cinzel', serif;
    color: var(--agency-accent);
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
}

.custom-rebuttals-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.custom-rebuttals-empty {
    color: #8b8b8b;
    font-style: italic;
    padding: 1rem 0;
}

.custom-rebuttals-section.has-none .custom-rebuttals-empty {
    padding: 0.5rem 0;
}

.rebuttal-section.custom-rebuttal {
    position: relative;
}

.delete-rebuttal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    color: #8b8b8b;
    background: transparent;
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-rebuttal-btn:hover {
    color: var(--agency-accent-hover);
    border-color: var(--agency-accent-hover);
}

/* Rebuttal modal */
.rebuttal-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.rebuttal-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.rebuttal-modal {
    background: linear-gradient(145deg, #1a1a1a 0%, #141414 100%);
    border: 1px solid #2d2d2d;
    border-radius: 12px;
    padding: 2rem;
    max-width: 520px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.rebuttal-modal-title {
    font-family: 'Cinzel', serif;
    color: var(--agency-accent);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.rebuttal-form label {
    display: block;
    color: #c9c9c9;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.rebuttal-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: #0d0d0d;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    color: #e8e8e8;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

.rebuttal-form textarea:focus {
    outline: none;
    border-color: var(--agency-accent);
}

.suggest-row {
    margin-bottom: 0.5rem;
}

.suggest-btn {
    font-size: 0.9rem;
    color: var(--agency-accent);
    background: transparent;
    border: 1px solid var(--agency-accent);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggest-btn:hover {
    background: rgba(var(--agency-accent-rgb), 0.15);
}

.rebuttal-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.rebuttal-modal-cancel,
.rebuttal-modal-save {
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.rebuttal-modal-cancel {
    background: transparent;
    border: 1px solid #3d3d3d;
    color: #8b8b8b;
}

.rebuttal-modal-cancel:hover {
    border-color: #5d5d5d;
    color: #c9c9c9;
}

.rebuttal-modal-save {
    background: var(--agency-accent);
    border: none;
    color: #0d0d0d;
}

.rebuttal-modal-save:hover {
    background: var(--agency-accent-hover);
}

/* Practice Rebuttal section */
.practice-rebuttal-section {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid #2d2d2d;
}

.practice-rebuttal-title {
    font-family: 'Cinzel', serif;
    color: var(--agency-accent);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.practice-rebuttal-intro {
    color: #8b8b8b;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.practice-get-rebuttal-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--agency-accent);
    background: transparent;
    border: 2px solid var(--agency-accent);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}

.practice-get-rebuttal-btn:hover {
    background: rgba(var(--agency-accent-rgb), 0.15);
    box-shadow: 0 0 15px rgba(var(--agency-accent-rgb), 0.3);
}

.practice-content {
    background: linear-gradient(145deg, #1a1a1a 0%, #141414 100%);
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-top: 1rem;
}

.practice-objection {
    font-family: 'Cinzel', serif;
    color: var(--agency-accent);
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    min-height: 2rem;
}

.practice-objection.has-objection {
    border-left: 3px solid var(--agency-accent);
    padding-left: 1rem;
}

.practice-recording-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.practice-record-btn {
    font-size: 1rem;
    color: var(--agency-accent);
    background: transparent;
    border: 1px solid var(--agency-accent);
    border-radius: 6px;
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.practice-record-btn:hover:not(:disabled) {
    background: rgba(var(--agency-accent-rgb), 0.15);
}

.practice-record-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.practice-record-status {
    color: #8b8b8b;
    font-size: 0.9rem;
}

.practice-transcript-area {
    margin-bottom: 1rem;
}

.practice-transcript-area label {
    display: block;
    color: #c9c9c9;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.practice-transcript-area textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #0d0d0d;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    color: #e8e8e8;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

.practice-transcript-area textarea:focus {
    outline: none;
    border-color: var(--agency-accent);
}

.practice-transcript-area textarea:disabled {
    opacity: 0.7;
}

.practice-submit-btn {
    font-size: 1rem;
    font-weight: 600;
    color: #0d0d0d;
    background: var(--agency-accent);
    border: none;
    border-radius: 6px;
    padding: 0.65rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.practice-submit-btn:hover:not(:disabled) {
    background: var(--agency-accent-hover);
}

.practice-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.practice-results {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #2d2d2d;
}

.practice-results.has-results {
    display: block;
}

.practice-grade {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: var(--agency-accent);
    margin-bottom: 1rem;
}

.practice-suggestions {
    margin-bottom: 1.25rem;
}

.practice-suggestions strong {
    color: #c9c9c9;
    display: block;
    margin-bottom: 0.5rem;
}

.practice-suggestions ul {
    margin: 0;
    padding-left: 1.25rem;
}

.practice-suggestions li {
    color: #a0a0a0;
    margin-bottom: 0.35rem;
}

.practice-reference {
    margin-top: 1rem;
}

.practice-reference strong {
    color: #c9c9c9;
    display: block;
    margin-bottom: 0.5rem;
}

.practice-reference .rebuttal-response {
    margin: 0;
}

.phase-block {
    margin-bottom: 1rem;
}

.phase-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e8e8e8;
    background: linear-gradient(145deg, #1a1a1a 0%, #141414 100%);
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.phase-btn:hover {
    border-color: var(--agency-accent-hover);
    color: var(--agency-accent);
    box-shadow: 0 0 15px rgba(var(--agency-accent-rgb), 0.2);
}

.phase-btn[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.phase-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: linear-gradient(145deg, #141414 0%, #0d0d0d 100%);
    border: 1px solid #2d2d2d;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.phase-panel.open {
    max-height: 5000px;
}

.phase-content, .phase-intro {
    padding: 1.25rem 1.5rem;
    color: #c9c9c9;
}

.phase-intro {
    margin-bottom: 0;
    padding-bottom: 0.5rem;
}

.reality-slideshow {
    position: relative;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reality-slide-btn {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    font-size: 1.75rem;
    line-height: 1;
    color: #c9c9c9;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reality-slide-btn:hover {
    color: var(--agency-accent);
    border-color: var(--agency-accent-hover);
    background: rgba(40, 40, 40, 0.95);
}

.reality-slides {
    flex: 1;
    position: relative;
    min-height: 180px;
}

.reality-slide {
    display: none;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(145deg, rgba(var(--agency-accent-rgb), 0.08) 0%, rgba(20, 20, 20, 0.95) 100%);
    border: 1px solid rgba(var(--agency-accent-rgb), 0.4);
    border-radius: 8px;
    color: #c9c9c9;
}

.reality-slide.active {
    display: block;
}

.reality-box {
    margin: 1.5rem 0;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(145deg, rgba(var(--agency-accent-rgb), 0.08) 0%, rgba(20, 20, 20, 0.95) 100%);
    border: 1px solid rgba(var(--agency-accent-rgb), 0.4);
    border-radius: 8px;
    color: #c9c9c9;
}

.reality-slideshow .reality-slide.reality-box {
    margin: 0;
}

.reality-box h3,
.reality-slide h3 {
    color: var(--agency-accent);
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    margin: 0 0 1rem;
}

.reality-box p,
.reality-slide p {
    margin: 0.75rem 0;
}

.reality-box p:first-of-type,
.reality-slide p:first-of-type {
    margin-top: 0;
}

.reality-box ul,
.reality-slide ul {
    margin: 0.5rem 0 1rem;
    padding-left: 1.25rem;
}

.reality-box li,
.reality-slide li {
    margin-bottom: 0.35rem;
}

.phase-content h4, .module-content h4 {
    color: var(--agency-accent);
    font-size: 0.95rem;
    margin: 1rem 0 0.5rem;
}

.phase-content ul, .module-content ul {
    margin: 0.5rem 0 1rem;
    padding-left: 1.25rem;
}

.phase-content li, .module-content li {
    margin-bottom: 0.35rem;
}

.module-block {
    margin: 0.5rem 1rem 1rem;
    border: 1px solid #2d2d2d;
    border-radius: 6px;
    overflow: hidden;
}

.module-btn {
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #c9c9c9;
    background: #1a1a1a;
    border: none;
    border-bottom: 1px solid #2d2d2d;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.module-btn:hover {
    color: var(--agency-accent);
    background: rgba(var(--agency-accent-rgb), 0.08);
}

.module-btn[aria-expanded="true"] {
    color: var(--agency-accent);
    border-bottom-color: #2d2d2d;
}

.module-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
}

.module-panel.open {
    max-height: 2000px;
}

.module-content {
    padding: 1rem 1.25rem 1.25rem;
    color: #a0a0a0;
    font-size: 0.95rem;
}

.module-content p {
    margin: 0.5rem 0 1rem;
}

/* Unit quizzes and locking */
.unit-locked .phase-btn {
    opacity: 0.7;
    cursor: not-allowed;
}

.unit-locked .phase-btn:hover {
    border-color: #3d3d3d;
    color: #e8e8e8;
    box-shadow: none;
}

.unit-lock-badge {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.85rem;
    color: #8b8b8b;
    font-weight: 400;
}

.unit-pass-badge {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.85rem;
    color: #6b9b6b;
    font-weight: 600;
}

.unit-quiz-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #2d2d2d;
}

.unit-quiz {
    padding: 0;
}

.quiz-title {
    color: var(--agency-accent);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.quiz-slides {
    position: relative;
    min-height: 180px;
}

.quiz-slides.hidden {
    display: none;
}

.quiz-progress {
    font-size: 0.9rem;
    color: #8b8b8b;
    margin-bottom: 1rem;
}

.quiz-slide {
    display: none;
    animation: quiz-slide-in 0.3s ease;
}

.quiz-slide.active {
    display: block;
}

@keyframes quiz-slide-in {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.quiz-nav {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.quiz-prev,
.quiz-next {
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-prev {
    color: #8b8b8b;
    background: transparent;
    border: 1px solid #3d3d3d;
}

.quiz-prev:hover:not(:disabled) {
    color: #e8e8e8;
    border-color: var(--agency-accent-hover);
}

.quiz-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quiz-next {
    color: #0d0d0d;
    background: var(--agency-accent);
    border: none;
}

.quiz-next:hover {
    background: var(--agency-accent-hover);
}

.quiz-question {
    margin-bottom: 1.25rem;
}

.quiz-q {
    font-weight: 600;
    color: #e8e8e8;
    margin-bottom: 0.5rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    color: #a0a0a0;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.quiz-option:hover {
    color: #e8e8e8;
    background: rgba(var(--agency-accent-rgb), 0.08);
}

.quiz-option input[type="radio"] {
    margin-top: 0.25rem;
    accent-color: var(--agency-accent);
}

.quiz-submit {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: #0d0d0d;
    background: var(--agency-accent);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-submit:hover {
    background: var(--agency-accent-hover);
}

.quiz-pass {
    color: #6b9b6b;
    font-weight: 600;
    padding: 1rem;
    background: rgba(107, 155, 107, 0.15);
    border-radius: 8px;
    border: 1px solid rgba(107, 155, 107, 0.15);
}

.quiz-fail {
    color: #8b8b8b;
    padding: 1rem 0 0.5rem;
}

.quiz-missed {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(139, 50, 50, 0.1);
    border: 1px solid rgba(139, 50, 50, 0.3);
    border-radius: 8px;
}

.quiz-missed h5 {
    color: var(--agency-accent);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.quiz-missed ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quiz-missed li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #2d2d2d;
    color: #a0a0a0;
    font-size: 0.9rem;
}

.quiz-missed li:last-child {
    border-bottom: none;
}

.quiz-wrong {
    color: #c95c5c;
}

.quiz-correct {
    color: #6b9b6b;
}

.quiz-retry {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: var(--agency-accent);
    background: transparent;
    border: 1px solid var(--agency-accent-hover);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-retry:hover {
    background: rgba(var(--agency-accent-rgb), 0.15);
}

/* Agency Activity dashboard */
.agency-activity-container {
    margin-top: 1.5rem;
}

.agency-loading,
.agency-empty,
.agency-error {
    color: #8b8b8b;
    padding: 1.5rem;
    text-align: center;
}

.agency-error {
    color: #c95a5a;
}

.agency-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.agency-agent-card {
    background: linear-gradient(145deg, #141414 0%, #1a1a1a 100%);
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    padding: 1.25rem;
    transition: border-color 0.2s;
}

.agency-agent-card:hover {
    border-color: rgba(var(--agency-accent-rgb), 0.4);
}

.agency-agent-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #2d2d2d;
}

.agency-agent-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e8e8e8;
    margin: 0 0 0.25rem 0;
}

.agency-agent-email {
    font-size: 0.85rem;
    color: #8b8b8b;
    margin: 0;
}

.agency-agent-progress {
    margin-bottom: 1rem;
}

.agency-progress-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.agency-progress-label {
    color: #8b8b8b;
}

.agency-progress-value {
    color: #c9c9c9;
}

.agency-agent-struggles h4 {
    font-size: 0.9rem;
    color: var(--agency-accent);
    margin: 0 0 0.5rem 0;
}

.agency-agent-struggles ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: #c9c9c9;
}

.agency-agent-struggles li {
    padding: 0.35rem 0;
    border-bottom: 1px solid #2d2d2d;
}

.agency-agent-struggles li:last-child {
    border-bottom: none;
}

.agency-struggle-count {
    color: #8b8b8b;
    font-size: 0.8em;
}

.agency-no-struggles {
    color: #5a5a5a;
    font-style: italic;
    margin: 0;
}
