/* =====================================================
   VersatileX OneAI — module-specific styles
   Extends assets/css/style.css tokens
   ===================================================== */

.oneai-hero { padding-bottom: 40px; }

/* ===== Module grid (landing page) ===== */
.oneai-modules { padding: 20px 0 72px; }

.module-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
}
@media (min-width: 860px) {
    .module-grid { grid-template-columns: repeat(3, 1fr); }
}

.module-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 28px 26px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
    min-height: 240px;
    cursor: pointer;
}
.module-card:hover,
.module-card:focus-visible {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--blue);
}
[data-theme="dark"] .module-card:hover,
[data-theme="dark"] .module-card:focus-visible {
    border-color: var(--cyan);
}
.module-card h2 {
    font-size: 21px;
    margin: 4px 0 10px;
    padding-right: 30px; /* keep clear of the corner arrow */
}
.module-card p {
    font-size: 14.5px;
    color: var(--text-soft);
    margin: 0 0 18px;
    flex-grow: 1;
}
.module-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--blue);
}
[data-theme="dark"] .module-card__cta { color: var(--cyan); }
.module-card__cta svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s var(--ease);
}
.module-card:hover .module-card__cta svg,
.module-card:focus-visible .module-card__cta svg {
    transform: translateX(4px);
}
.module-card__arrow {
    position: absolute;
    top: 26px;
    right: 26px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grad);
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
    transition: transform 0.2s var(--ease);
}
.module-card:hover .module-card__arrow,
.module-card:focus-visible .module-card__arrow {
    transform: scale(1.1);
}

.oneai-rules {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px 30px;
}
.oneai-rules h3 {
    font-size: 16px;
    margin-bottom: 12px;
}
.oneai-rules ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-soft);
    font-size: 14.5px;
    line-height: 1.8;
}

/* ===== Shared module page shell ===== */
.module-shell {
    padding: 48px 0 80px;
}
.module-shell__header {
    margin-bottom: 32px;
}
.module-shell__header a.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--navy-text);
    text-decoration: none;
    margin-bottom: 20px;
    padding: 8px 16px 8px 12px;
    border-radius: 999px;
    border: 1.5px solid var(--border-strong);
    background: var(--surface);
    transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.module-shell__header a.back-link:hover {
    border-color: var(--blue);
    transform: translateX(-2px);
}
[data-theme="dark"] .module-shell__header a.back-link:hover { border-color: var(--cyan); }

.module-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    max-width: 780px;
}
.module-panel--wide { max-width: 940px; }

/* ===== Form elements ===== */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    margin-bottom: 8px;
    font-weight: 600;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 620px) {
    .form-row--2 { grid-template-columns: 1fr 1fr; }
}

.input, .select, .textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    padding: 13px 16px;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--glow);
}
.textarea { resize: vertical; min-height: 110px; font-family: var(--font-body); }

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1.5px solid var(--border-strong);
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s var(--ease);
}
.chip input { display: none; }
.chip:hover { border-color: var(--blue); }
.chip.is-selected {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
}

.form-hint {
    font-size: 12.5px;
    color: var(--text-faint);
    margin-top: 6px;
}
.form-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #DC2626;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 20px;
}
[data-theme="dark"] .form-error { color: #FCA5A5; }

.btn--block { width: 100%; }
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== Loading / spinner ===== */
.vx-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vx-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes vx-spin { to { transform: rotate(360deg); } }

.loading-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-soft);
}
.loading-state .vx-spinner {
    width: 30px; height: 30px;
    border-color: var(--border-strong);
    border-top-color: var(--blue);
    margin: 0 0 16px;
}

/* ===== Lock notice ===== */
.lock-notice {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    max-width: 560px;
}
.lock-notice__icon {
    width: 44px; height: 44px;
    margin: 0 auto 16px;
    color: var(--text-faint);
}
.lock-notice h2 { font-size: 20px; }
.lock-notice p { color: var(--text-soft); font-size: 14.5px; }

/* ===== Diagnostic question flow ===== */
.q-progress {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
}
.q-progress__dot {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: var(--border);
}
.q-progress__dot.is-done { background: var(--grad); }
.q-progress__dot.is-current { background: var(--blue-deep); }

.q-card {
    margin-bottom: 24px;
}
.q-card__tag {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--blue);
    margin-bottom: 10px;
}
[data-theme="dark"] .q-card__tag { color: var(--cyan); }
.q-card__text {
    font-size: 17px;
    font-weight: 500;
    color: var(--navy-text);
    margin-bottom: 16px;
    line-height: 1.5;
}
.q-options { display: flex; flex-direction: column; gap: 10px; }
.q-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}
.q-option:hover { border-color: var(--blue); }
.q-option.is-selected {
    border-color: var(--blue);
    background: var(--glow);
}
.q-option input { accent-color: var(--blue); }

/* ===== Result / report card ===== */
.report-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}
.report-card__greeting {
    font-family: var(--font-display);
    font-size: 24px;
    margin-bottom: 6px;
}

.report-bullets {
    list-style: none;
    margin: 20px 0 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.report-bullets li {
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text);
    padding: 12px 16px;
    background: var(--surface-alt);
    border-radius: 10px;
    border-left: 3px solid var(--blue);
}
[data-theme="dark"] .report-bullets li { border-left-color: var(--cyan); }
.report-bullets li strong {
    color: var(--navy-text);
    font-weight: 700;
}

#toggle-detail-btn { margin-bottom: 4px; }
#report-detail { margin-top: 8px; }

.report-section {
    margin: 22px 0;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.report-section:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.report-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
    color: var(--text-faint);
    margin-bottom: 10px;
}
.report-section p { color: var(--text); font-size: 15px; line-height: 1.7; }

.report-recommend {
    background: var(--navy);
    color: var(--invert-text);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 10px;
}
.report-recommend h3 {
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.report-recommend p { font-size: 15px; line-height: 1.7; }

/* ===== Ask doubt (chat-style) ===== */
.doubt-answer__meta {
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--blue);
    margin: 0 0 14px;
}
[data-theme="dark"] .doubt-answer__meta { color: var(--cyan); }

.doubt-answer {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 24px;
    font-size: 15px;
    line-height: 1.75;
}
.doubt-answer h4 {
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    margin: 0 0 12px;
}
.doubt-answer p {
    margin: 0 0 14px;
}
.doubt-answer p:last-child {
    margin-bottom: 0;
}
.doubt-answer strong {
    color: var(--navy-text);
    font-weight: 700;
}

.image-drop {
    border: 1.5px dashed var(--border-strong);
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    cursor: pointer;
    color: var(--text-soft);
    font-size: 13.5px;
    transition: border-color 0.15s var(--ease);
}
.image-drop:hover { border-color: var(--blue); }
.image-drop.has-file { border-style: solid; border-color: var(--blue); }
.image-drop input { display: none; }
.image-preview {
    max-width: 100%;
    max-height: 180px;
    border-radius: 8px;
    margin-top: 10px;
}

/* ===== Notebook upload ===== */
.file-drop {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-md);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s var(--ease);
}
.file-drop:hover { border-color: var(--blue); }
.file-drop.has-file { border-style: solid; border-color: var(--sage); }
.file-drop input { display: none; }
.file-drop__icon {
    width: 36px; height: 36px;
    margin: 0 auto 12px;
    color: var(--text-faint);
}
.file-drop__name {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--text);
    margin-top: 8px;
    word-break: break-all;
}

/* ===== Utility ===== */
.mt-24 { margin-top: 24px; }
.text-center { text-align: center; }