/* Reset and Base Styles */
:root {
    --bg: #f7f8fb;
    --card: #ffffff;
    --text: #162e42;
    --muted: #6b7280;
    --accent: #2676a7;
    --accent-hover: #1a3a50;
    --gold: #be9e52;
    --navy-dark: #162e42;
    --navy-light: #1a3a50;
    --blue: #2676a7;
    --border: #e6e9ef;
    --maxw: 1100px;
    --success: #16a34a;
    --warning: #ea580c;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 32px 16px;
}

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    padding: 40px;
    border: 1px solid var(--border);
}

/* Headings use Montserrat */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* Logo and Branding */
.logo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    gap: 24px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.brand-text h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: var(--navy-dark);
    font-family: 'Montserrat', sans-serif;
}

.brand-text p {
    margin: 4px 0 0 0;
    color: var(--muted);
    font-size: 14px;
}

.contact-info {
    text-align: right;
    color: var(--navy-dark);
    font-size: 14px;
    line-height: 1.8;
}

.contact-info strong {
    color: var(--gold);
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.contact-info a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-info a:hover {
    color: var(--gold);
}

/* Typography */
header > h1 {
    margin: 0 0 16px 0;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--navy-dark);
}

header p.lead {
    margin: 0 0 24px 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

h2 {
    font-size: 28px;
    margin: 32px 0 16px 0;
    font-weight: 600;
    color: var(--text);
}

h3 {
    font-size: 20px;
    margin: 20px 0 12px 0;
    font-weight: 600;
}

h4 {
    font-size: 16px;
    margin: 16px 0 8px 0;
    color: var(--accent);
    font-weight: 600;
}

p {
    margin: 12px 0;
    color: var(--text);
}

.intro-text {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 24px;
}

.small {
    font-size: 13px;
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

/* Lists */
ul {
    margin: 12px 0 20px 20px;
    padding: 0;
}

li {
    margin: 8px 0;
}

li strong {
    color: var(--accent);
}

/* Sections */
.grid {
    display: grid;
    gap: 32px;
}

.section-block {
    padding: 28px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Personality Grid */
.personality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.personality-card {
    background: linear-gradient(135deg, #2676a7 0%, #162e42 100%);
    border: none;
    border-radius: 12px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    text-align: center;
    box-shadow: 0 4px 12px rgba(38, 118, 167, 0.2);
}

.personality-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(190, 158, 82, 0.4);
    background: linear-gradient(135deg, #2676a7 0%, #1a3a50 100%);
}

.personality-card h3 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.personality-card .subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.95);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #2676a7 0%, #1a3a50 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(38, 118, 167, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #be9e52 0%, #2676a7 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(190, 158, 82, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

.close {
    color: var(--muted);
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover,
.close:focus {
    color: var(--text);
}

#buyer-detail h2 {
    color: var(--accent);
    margin-top: 0;
}

#buyer-detail h3 {
    color: var(--text);
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
    margin-top: 24px;
}

#buyer-detail ul {
    margin-left: 20px;
}

#buyer-detail li {
    margin: 10px 0;
}

/* Footer */
.footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Assessment-specific styles */
.question-item {
    background-color: #f8fafc;
    padding: 25px;
    margin: 20px 0;
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.question-text {
    font-weight: 600;
    color: var(--navy-dark);
    margin-bottom: 20px;
    font-size: 18px;
    line-height: 1.5;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-option {
    display: block;
    padding: 16px 20px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    text-align: left;
}

.answer-option:hover {
    background-color: #f0f8ff;
    border-color: var(--blue);
    transform: translateX(5px);
}

.answer-option.selected {
    background-color: #f0f8ff;
    border-color: var(--gold);
    border-width: 3px;
    font-weight: 600;
    color: var(--navy-dark);
}

/* Question fade animation */
.question-item {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    header > h1 {
        font-size: 28px;
    }

    header p.lead {
        font-size: 16px;
    }

    h2 {
        font-size: 24px;
    }

    .personality-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }

    .personality-card {
        padding: 24px 16px;
    }

    .personality-card h3 {
        font-size: 24px;
    }

    .modal-content {
        padding: 24px;
        width: 95%;
    }

    .logo-header {
        flex-direction: column;
        text-align: center;
    }

    .logo-section {
        flex-direction: column;
        text-align: center;
    }

    .contact-info {
        text-align: center;
    }

    .logo-image {
        width: 100px;
        height: 100px;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .answer-option {
        padding: 14px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 16px 8px;
    }

    .container {
        padding: 16px;
    }

    header > h1 {
        font-size: 24px;
    }

    .personality-grid {
        grid-template-columns: 1fr 1fr;
    }

    .logo-image {
        width: 80px;
        height: 80px;
    }

    .brand-text h1 {
        font-size: 24px;
    }
}

/* Contact Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--navy-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: white;
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(38, 118, 167, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23162e42' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    #agent-match-form {
        padding: 24px !important;
    }
}

.form-validation-error {
    border-color: var(--warning) !important;
}

.form-error-message {
    color: var(--warning);
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

#form-success {
    animation: fadeIn 0.5s ease;
}
