/* Scoped Stylesheet for Academic Master Scanner (Light Theme / Existing Site Matching) */

.am-scanner-container {
    --am-bg-main: #FFFFFF;
    --am-bg-subtle: #F8FAFC;
    --am-border: #E2E8F0;
    --am-border-hover: #CBD5E1;
    
    /* Accents */
    --am-cyan: #06B6D4;
    --am-purple: #8B5CF6;
    --am-pink: #EC4899;
    
    /* Status Colors */
    --am-color-human: #10B981;
    --am-color-ai: #F59E0B;
    --am-color-plag: #F43F5E;

    /* Text */
    --am-text-dark: #0F172A;
    --am-text-muted: #64748B;
    --am-text-light: #FFFFFF;

    --am-font-heading: 'Outfit', sans-serif;
    --am-font-body: 'Inter', sans-serif;

    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: var(--am-font-body);
    color: var(--am-text-dark);
    line-height: 1.6;
}

/* Base resets inside container */
.am-scanner-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Hero Header */
.am-scanner-hero {
    text-align: center;
    margin-bottom: 52px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.am-badge {
    display: inline-block;
    padding: 6px 16px;
    background: #F0FDFA;
    color: #0D9488;
    border: 1px solid #CCFBF1;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.am-title {
    font-family: var(--am-font-heading);
    font-size: 48px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--am-text-dark);
    letter-spacing: -0.5px;
}

.am-text-accent {
    background: linear-gradient(135deg, var(--am-cyan), var(--am-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.am-subtitle {
    font-size: 18px;
    color: var(--am-text-muted);
    line-height: 1.7;
    margin-bottom: 24px;
}

/* User Welcome Banner */
.am-user-welcome-banner {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 12px 24px;
    border-radius: 16px;
    display: inline-block;
    font-size: 14px;
}

.am-status-unlocked {
    color: #059669;
    font-weight: 700;
    margin-left: 8px;
    background: #D1FAE5;
    padding: 2px 10px;
    border-radius: 12px;
}

.am-status-registered {
    color: #64748B;
    margin-left: 8px;
}

.am-status-registered a {
    color: #8B5CF6;
    font-weight: 600;
    text-decoration: underline;
}

/* Scanner Card Workspace */
.am-scanner-card {
    background: var(--am-bg-main);
    border: 1px solid var(--am-border);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    margin-bottom: 60px;
}

/* Tabs Header */
.am-scanner-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    border-bottom: 1px solid var(--am-border);
    background: var(--am-bg-subtle);
}

.am-tab-buttons {
    display: flex;
    gap: 20px;
}

.am-tab-btn {
    background: transparent;
    border: none;
    color: var(--am-text-muted);
    font-family: var(--am-font-body);
    font-size: 16px;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.am-tab-btn.active {
    color: var(--am-text-dark);
}

.am-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--am-cyan), var(--am-purple));
    border-radius: 3px;
}

.am-tab-btn.disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.am-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.am-pill-dot {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10B981;
}

/* Scanner Body */
.am-scanner-body {
    padding: 48px 40px;
}

.am-scanner-body.hidden {
    display: none;
}

/* Input Area */
.am-input-box {
    border: 2px solid var(--am-border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 32px;
    background: #FFFFFF;
    transition: border-color 0.2s ease;
}

.am-input-box:focus-within {
    border-color: var(--am-cyan);
}

#am-document-text {
    width: 100%;
    height: 320px;
    background: transparent;
    border: none;
    padding: 28px;
    color: var(--am-text-dark);
    font-family: var(--am-font-body);
    font-size: 16px;
    line-height: 1.7;
    resize: none;
    outline: none;
}

#am-document-text::placeholder {
    color: #94A3B8;
}

.am-textarea-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: var(--am-bg-subtle);
    border-top: 1px solid var(--am-border);
    flex-wrap: wrap;
    gap: 16px;
}

.am-action-group-left, .am-action-group-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.am-btn-sample, .am-btn-upload, .am-btn-clear {
    background: #FFFFFF;
    border: 1px solid var(--am-border);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--am-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--am-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.am-btn-sample:hover, .am-btn-upload:hover {
    background: #F1F5F9;
    color: var(--am-text-dark);
    border-color: var(--am-border-hover);
}

.am-btn-clear:hover {
    background: #FFF1F2;
    color: #E11D48;
    border-color: #FECDD3;
}

#am-word-counter {
    font-size: 13px;
    color: var(--am-text-muted);
    font-weight: 600;
}

/* Main Scan Button */
.am-btn-main {
    background: linear-gradient(135deg, var(--am-cyan), var(--am-purple));
    color: var(--am-text-light);
    font-family: var(--am-font-body);
    font-weight: 700;
    font-size: 18px;
    padding: 18px 40px;
    border: none;
    border-radius: 12px;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.am-btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(139, 92, 246, 0.45);
}

.am-icon {
    width: 24px;
    height: 24px;
}

.am-privacy-note {
    text-align: center;
    font-size: 13px;
    color: var(--am-text-muted);
    margin-top: 20px;
}

/* Scanning Animation View */
.am-scanning-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    text-align: center;
}

.am-spinner {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid #E2E8F0;
    border-top-color: var(--am-cyan);
    border-bottom-color: var(--am-purple);
    animation: am-spin 1.2s linear infinite;
    margin-bottom: 32px;
}

@keyframes am-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.am-scanning-title {
    font-family: var(--am-font-heading);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--am-text-dark);
}

.am-scanning-subtitle {
    color: var(--am-text-muted);
    font-size: 16px;
    max-width: 500px;
    margin-bottom: 40px;
}

.am-progress-bar-container {
    width: 100%;
    max-width: 500px;
    height: 8px;
    background: #E2E8F0;
    border-radius: 4px;
    overflow: hidden;
}

.am-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--am-cyan), var(--am-purple));
    transition: width 0.3s ease;
}

/* Results View */
.am-scores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 48px;
}

.am-score-card {
    background: var(--am-bg-subtle);
    border: 1px solid var(--am-border);
    border-radius: 20px;
    padding: 32px;
}

.am-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.am-score-label {
    font-family: var(--am-font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--am-text-dark);
}

.am-badge-warning {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.am-badge-danger {
    background: #FFE4E6;
    color: #E11D48;
    border: 1px solid #FECDD3;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.am-score-body {
    display: flex;
    align-items: center;
    gap: 32px;
}

.am-circle-chart {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}

.am-circular-svg {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.am-circle-bg {
    fill: none;
    stroke: #E2E8F0;
    stroke-width: 3.5;
}

.am-circle {
    fill: none;
    stroke-width: 3.5;
    stroke-linecap: round;
    animation: am-progress 1.5s ease-out forwards;
}

.am-circular-svg.warning .am-circle { stroke: var(--am-color-ai); }
.am-circular-svg.danger .am-circle { stroke: var(--am-color-plag); }

@keyframes am-progress {
    0% { stroke-dasharray: 0 100; }
}

.am-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--am-font-heading);
    font-size: 26px;
    font-weight: 700;
    color: var(--am-text-dark);
}

.am-score-summary {
    flex-grow: 1;
    color: var(--am-text-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* Highlights Section */
.am-highlights-section {
    margin-bottom: 48px;
}

.am-highlights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.am-highlights-header h3 {
    font-family: var(--am-font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--am-text-dark);
}

.am-legend {
    display: flex;
    gap: 20px;
}

.am-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--am-text-muted);
}

.am-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.am-box-ai { background-color: #FEF3C7; border: 1px solid #F59E0B; }
.am-box-plag { background-color: #FFE4E6; border: 1px solid #F43F5E; }
.am-box-human { background-color: #D1FAE5; border: 1px solid #10B981; }

.am-document-box {
    background: var(--am-bg-subtle);
    border: 1px solid var(--am-border);
    border-radius: 16px;
    padding: 32px;
    font-size: 16px;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
    color: var(--am-text-dark);
}

.am-highlight-ai {
    background-color: #FEF3C7;
    border-bottom: 2px solid #F59E0B;
    padding: 2px 4px;
    border-radius: 4px;
}

.am-highlight-plag {
    background-color: #FFE4E6;
    border-bottom: 2px solid #F43F5E;
    padding: 2px 4px;
    border-radius: 4px;
}

/* Conversion Banner */
.am-conversion-banner {
    background: linear-gradient(135deg, #FAF5FF, #FFF5F7);
    border: 2px solid #E9D8FD;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.05);
}

.am-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 48px;
}

.am-banner-text h3 {
    font-family: var(--am-font-heading);
    font-size: 26px;
    font-weight: 700;
    color: #6B21A8;
    margin-bottom: 12px;
}

.am-banner-text p {
    color: #475569;
    font-size: 16px;
    line-height: 1.7;
}

.am-banner-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.am-btn-premium {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
    font-family: var(--am-font-body);
    font-weight: 700;
    font-size: 16px;
    padding: 16px 36px;
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.am-btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(236, 72, 153, 0.45);
}

.am-guarantee {
    font-size: 13px;
    color: #64748B;
    font-weight: 500;
}

.am-results-footer {
    display: flex;
    justify-content: center;
}

.am-btn-secondary {
    background: #FFFFFF;
    border: 1px solid var(--am-border);
    color: var(--am-text-dark);
    font-family: var(--am-font-body);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 32px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.am-btn-secondary:hover {
    background: var(--am-bg-subtle);
    border-color: var(--am-border-hover);
}

/* Marketing Pitch Section */
.am-marketing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding-top: 20px;
}

.am-feature-item {
    background: #FFFFFF;
    border: 1px solid var(--am-border);
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.am-feature-item:hover {
    transform: translateY(-4px);
    border-color: var(--am-border-hover);
}

.am-feature-icon {
    font-size: 36px;
    margin-bottom: 24px;
}

.am-feature-item h3 {
    font-family: var(--am-font-heading);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--am-text-dark);
}

.am-feature-item p {
    color: var(--am-text-muted);
    font-size: 15px;
    line-height: 1.7;
}

/* =========================================================================
   GLASSMORPHISM MODAL POPUP (AUTH & LEAD CAPTURE)
   ========================================================================= */
.am-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.am-modal-backdrop.hidden {
    display: none;
    opacity: 0;
}

.am-modal-container {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 24px;
    width: 100%;
    max-width: 540px;
    padding: 48px 40px;
    box-shadow: 0 25px 80px rgba(15, 23, 42, 0.2);
    position: relative;
    font-family: 'Inter', sans-serif;
    transform: translateY(0);
    animation: am-modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes am-modal-pop {
    0% { transform: translateY(20px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.am-modal-close {
    position: absolute;
    top: 24px;
    right: 28px;
    background: #F1F5F9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.am-modal-close:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.am-modal-header {
    margin-bottom: 32px;
    text-align: center;
}

.am-modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 12px;
}

.am-modal-subtitle {
    font-size: 15px;
    color: #64748B;
    line-height: 1.6;
}

.am-modal-tabs {
    display: flex;
    background: #F8FAFC;
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 32px;
    border: 1px solid #E2E8F0;
}

.am-modal-tab-btn {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #64748B;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.am-modal-tab-btn.active {
    background: #FFFFFF;
    color: #0F172A;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.am-auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.am-auth-form.hidden {
    display: none;
}

.am-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.am-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
}

.am-form-group input {
    padding: 14px 18px;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #0F172A;
    outline: none;
    transition: border-color 0.2s ease;
}

.am-form-group input:focus {
    border-color: #06B6D4;
}

.am-auth-error {
    background: #FFE4E6;
    border: 1px solid #FECDD3;
    color: #E11D48;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.am-auth-error.hidden {
    display: none;
}

.am-btn-auth-submit {
    background: linear-gradient(135deg, #06B6D4, #8B5CF6);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.am-btn-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(139, 92, 246, 0.45);
}

.am-auth-tip {
    font-size: 13px;
    color: #64748B;
    text-align: center;
    margin-top: 8px;
    line-height: 1.6;
}

/* OTP Form Styles */
.am-otp-instructions {
    text-align: center;
    font-size: 15px;
    color: #0F172A;
    line-height: 1.6;
    margin-bottom: 8px;
}

.am-otp-small {
    font-size: 13px;
    color: #64748B;
    margin-top: 4px;
}

.am-otp-group {
    align-items: center;
}

.am-otp-input {
    width: 180px;
    text-align: center;
    font-size: 28px !important;
    letter-spacing: 12px;
    font-weight: 700;
    padding: 12px !important;
    border-radius: 16px !important;
}

.am-otp-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.am-otp-footer a {
    color: #06B6D4;
    text-decoration: none;
    font-weight: 600;
}

.am-otp-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 992px) {
    .am-scores-grid, .am-marketing-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .am-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 32px;
    }
}
