/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Eurostile:wght@400&display=swap');

/*
ATX Defense Brand Identity:
- Background: #323232 (Dark Gray)
- Primary/Button Color: #D15E14 (Orange)
- Headlines (h1, h2, h3, h4): Eurostile Regular (font-weight: 400)
- Body text: Open Sans Regular (font-weight: 400)
- Labels, buttons, emphasis: Open Sans SemiBold (font-weight: 600)
- Strong emphasis: Open Sans Bold (font-weight: 700)
*/

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 400; /* Open Sans Regular */
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: #323232;
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: grid;
    grid-template-columns: 120px 1fr 120px; /* Logo width, center content, balance width */
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 30px;
}

.logo-section {
    grid-column: 1;
}

.company-logo {
    height: 50px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    border-radius: 4px;
}

/* Fallback styling if logo is missing */
.company-logo:not([src]), .company-logo[src=""] {
    display: none;
}

.title-section {
    grid-column: 2;
    text-align: center;
}

.header h1 {
    font-family: 'Eurostile', 'Arial Black', sans-serif;
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header h2 {
    font-family: 'Eurostile', 'Arial Black', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 10px;
    opacity: 0.9;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Steps */
.step {
    display: none;
    width: 100%;
    max-width: 600px;
}

.step.active {
    display: block;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card h3 {
    font-family: 'Eurostile', 'Arial Black', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 15px;
    color: #2c3e50;
}

.card p {
    margin-bottom: 25px;
    color: #666;
    font-size: 1rem;
}

/* Form elements */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="date"],
textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
textarea:focus {
    outline: none;
    border-color: #D15E14;
    box-shadow: 0 0 0 3px rgba(209, 94, 20, 0.1);
}

/* Intake Form */
.intake-form {
    margin-top: 15px;
}

.intake-form .form-group {
    margin-bottom: 15px;
}

/* File upload area */
.file-upload-area {
    position: relative;
    border: 2px dashed #e0e6ed;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #D15E14; /* ATX Defense brand orange */
    background-color: #fef5f0; /* Light orange background */
}

.file-upload-area.dragover {
    border-color: #D15E14; /* ATX Defense brand orange */
    background-color: #fef0e7; /* Slightly darker orange background */
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-prompt {
    pointer-events: none;
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 15px;
    fill: #D15E14; /* ATX Defense brand orange */
}

.upload-prompt p {
    margin: 10px 0;
    color: #666;
}

.file-types {
    font-size: 0.9rem;
    color: #999;
}

/* Selected files */
.selected-files {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    fill: #D15E14; /* ATX Defense brand orange */
}

.file-name {
    font-weight: 600; /* Open Sans SemiBold */
    color: #2c3e50;
    margin-right: 10px;
}

.file-size {
    color: #666;
    font-size: 0.9rem;
}

.file-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.file-remove:hover {
    background-color: #ffeaea;
}

/* Upload info */
.upload-info {
    background: #f8f9ff;
    border: 1px solid #e0e8ff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.upload-info h4 {
    font-family: 'Eurostile', 'Arial Black', sans-serif;
    font-weight: 400;
    color: #2c3e50;
    margin-bottom: 10px;
}

.upload-info ul {
    list-style: none;
    padding-left: 0;
}

.upload-info li {
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
}

.upload-info li::before {
    content: "";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

/* Download info (reused for intake form) */
.download-info {
    background: #f8fff9;
    border: 1px solid #d4edda;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.download-info h4 {
    font-family: 'Eurostile', 'Arial Black', sans-serif;
    font-weight: 400;
    color: #2c3e50;
    margin-bottom: 10px;
}

.download-info p {
    color: #666;
    margin-bottom: 15px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    min-width: 120px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #D15E14; /* ATX Defense brand orange */
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(209, 94, 20, 0.4); /* Orange shadow */
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e6ed;
}

.btn-secondary:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Success card */
.success-card {
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.upload-summary {
    background: #f8fff9;
    border: 1px solid #d4edda;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    text-align: left;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9f7ef;
}

.summary-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.next-steps {
    background: #f8f9ff;
    border: 1px solid #e0e8ff;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    text-align: left;
}

.next-steps h4 {
    font-family: 'Eurostile', 'Arial Black', sans-serif;
    font-weight: 400;
    color: #2c3e50;
    margin-bottom: 10px;
}

/* Error messages */
.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 8px;
    padding: 8px 12px;
    background: #ffeaea;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    padding: 30px 20px;
    margin-top: 40px;
    opacity: 0.8;
}

.footer p {
    margin-bottom: 10px;
}

.footer a {
    color: white;
    text-decoration: underline;
}

.footer a:hover {
    opacity: 0.8;
}

.footer-help {
    color: #333 !important;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
}

.footer-help a {
    color: #0066cc !important;
    text-decoration: underline;
    font-weight: 500;
}

.footer-help a:hover {
    color: #004499 !important;
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 20px 10px;
        margin-bottom: 20px;
    }

    .header-content {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px;
        text-align: center;
    }

    .logo-section {
        grid-column: 1;
        justify-self: center;
    }

    .company-logo {
        height: 60px;
        max-width: 150px;
    }

    .title-section {
        grid-column: 1;
        text-align: center;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header h2 {
        font-size: 1.3rem;
    }

    .card {
        padding: 25px 20px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn.loading::after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Collapsible templates section */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.collapsible-header:hover {
    background-color: rgba(0, 123, 255, 0.05);
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.collapsible-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
}

.collapse-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    fill: #007bff;
}

.collapsible-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.collapsible-content p {
    margin-top: 10px;
    margin-bottom: 15px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e6ed;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #D15E14;
}

.tab-btn.active {
    color: #D15E14;
    border-bottom-color: #D15E14;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Uploaded Files Section */
.uploaded-files-section {
    margin-top: 20px;
}

.uploaded-files-section h4 {
    font-family: 'Eurostile', 'Arial Black', sans-serif;
    font-weight: 400;
    color: #2c3e50;
    margin-bottom: 10px;
}

.uploaded-files-section p {
    color: #666;
    margin-bottom: 20px;
}

.uploaded-files-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uploaded-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.uploaded-file-item:hover {
    border-color: #D15E14;
    box-shadow: 0 2px 8px rgba(209, 94, 20, 0.1);
}

.uploaded-file-item .file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.uploaded-file-item .file-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.uploaded-file-item .file-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.uploaded-file-item .file-meta {
    font-size: 0.85rem;
    color: #666;
}

.btn-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: none;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    color: #e74c3c;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: #e74c3c;
    color: white;
}

.loading-message,
.no-files-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 1rem;
}

.no-files-message {
    background: #f8f9fa;
    border: 1px dashed #e0e6ed;
    border-radius: 8px;
}

/* Responsive tabs */
@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
        gap: 0;
        border-bottom: none;
    }

    .tab-btn {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #e0e6ed;
        margin-bottom: 0;
    }

    .tab-btn.active {
        background: #fef5f0;
        border-left: 4px solid #D15E14;
    }

    .uploaded-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .uploaded-file-item .file-info {
        width: 100%;
    }

    .btn-delete {
        align-self: flex-end;
    }
}


/* Admin Styles */
.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.admin-email {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-width: auto;
}

.admin-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

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

.card-header h3 {
    margin-bottom: 0;
}

.search-bar {
    margin-bottom: 20px;
}

.search-bar input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-bar input[type="text"]:focus {
    outline: none;
    border-color: #D15E14;
    box-shadow: 0 0 0 3px rgba(209, 94, 20, 0.1);
}

.required {
    color: #e74c3c;
}

textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #D15E14;
    box-shadow: 0 0 0 3px rgba(209, 94, 20, 0.1);
}

select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #D15E14;
    box-shadow: 0 0 0 3px rgba(209, 94, 20, 0.1);
}

.success-message {
    color: #27ae60;
    font-size: 0.9rem;
    margin-top: 8px;
    padding: 8px 12px;
    background: #e8f8f5;
    border: 1px solid #a9dfbf;
    border-radius: 4px;
    display: none;
}

.success-message.show {
    display: block;
}

/* Assessment Result */
.assessment-result {
    margin-top: 30px;
    padding: 20px;
    background: #e8f8f5;
    border: 2px solid #27ae60;
    border-radius: 8px;
}

.assessment-result h4 {
    font-family: 'Eurostile', 'Arial Black', sans-serif;
    color: #27ae60;
    margin-bottom: 15px;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-item strong {
    min-width: 120px;
    color: #2c3e50;
}

.upload-key {
    font-family: monospace;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid #e0e6ed;
}

.btn-copy {
    padding: 4px 12px;
    background: #D15E14;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.btn-copy:hover {
    background: #b84f0f;
}

.result-note {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
}

/* Assessments List */
.assessments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.assessment-card {
    background: #f8f9fa;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.assessment-card:hover {
    border-color: #D15E14;
    box-shadow: 0 2px 8px rgba(209, 94, 20, 0.1);
}

.assessment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e6ed;
}

.assessment-header h4 {
    font-family: 'Eurostile', 'Arial Black', sans-serif;
    color: #2c3e50;
    margin: 0;
    font-size: 1.1rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.assessment-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.assessment-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.assessment-detail strong {
    font-size: 0.85rem;
    color: #666;
}

.assessment-detail span {
    color: #2c3e50;
}

.upload-key-small {
    font-family: monospace;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid #e0e6ed;
    display: inline-block;
}

.assessment-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 1.1rem;
}

.login-info {
    margin-top: 20px;
    text-align: center;
}

.login-info a {
    color: #D15E14;
    text-decoration: none;
}

.login-info a:hover {
    text-decoration: underline;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .admin-header-actions {
        flex-direction: column;
        gap: 8px;
    }

    .assessment-body {
        grid-template-columns: 1fr;
    }

    .assessment-actions {
        flex-direction: column;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-item strong {
        min-width: auto;
    }
}

/* Load More Button */
#load-more-btn {
    display: block;
    margin: 20px auto;
    width: 200px;
}

/* Intake Form Styling */
.required {
    color: #e74c3c;
    font-weight: bold;
}

.intake-form select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.3s ease;
}

.intake-form select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.intake-form input.pre-filled,
.intake-form select.pre-filled {
    background-color: #f0f8ff;
    border-color: #4a90e2;
}

.pre-filled-indicator {
    color: #4a90e2;
    font-size: 0.85rem;
    font-weight: normal;
    font-style: italic;
    margin-left: 5px;
}

.intake-form input.pre-filled::placeholder,
.intake-form select.pre-filled::placeholder {
    color: #7ba7d6;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
    width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e6ed;
}

.modal-header h3 {
    margin: 0;
    color: #323232;
    font-family: 'Eurostile', sans-serif;
    font-weight: 400;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    color: #323232;
}

.modal-body {
    padding: 30px;
}