:root {
    --primary-color: #1d6292;
    --primary-light: #2a7cae;
    --primary-dark: #14496b;
    --bg-color: #e5e7eb; /* Light gray page background as requested */
    --card-bg: #ffffff; /* White card background as requested */
    --text-dark: #1f2937;
    --text-body: #4b5563;
    --text-muted: #6b7280;
    --border-color: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    font-family: 'Lato', sans-serif;
    color: var(--text-body);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .card-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: var(--text-dark);
}

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

header {
    text-align: center;
    margin-bottom: 3.5rem;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.75rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-muted);
    font-size: 1.15rem;
}

.main-content {
    display: flex;
    gap: 4rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

.form-section {
    flex: 1;
    min-width: 320px;
    max-width: 450px;
}

.preview-section {
    flex: 1;
    min-width: 320px;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.form-card {
    background: #ffffff;
}

.form-card h2 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
}

.form-card h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
    margin-left: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
}

input, textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
    background-color: #f9fafb;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(29, 98, 146, 0.15);
    background-color: #ffffff;
}

input::placeholder, textarea::placeholder {
    color: #9ca3af;
}

.file-input {
    padding: 0.5rem;
    background-color: #ffffff;
}

.file-input::file-selector-button {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.file-input::file-selector-button:hover {
    background-color: #cbd5e1;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.download-container {
    margin-top: 1.5rem;
    text-align: center;
    width: 100%;
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    margin-top: 0;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

.hidden {
    display: none !important;
}

/* Speaker Card Styles */
.card-wrapper {
    width: 100%;
    perspective: 1000px;
}

.speaker-card {
    /* 1080x1080 social media card, scaled down for preview */
    width: 540px;
    height: 540px;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border-top: 8px solid var(--primary-color);
    display: flex;
    flex-direction: column;
}

.speaker-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-6px);
}

.speaker-card.empty {
    opacity: 0.6;
    filter: grayscale(0.2);
    border-top-color: #cbd5e1;
}

.speaker-card.empty:hover {
    transform: translateY(0);
    box-shadow: var(--shadow-lg);
}

/* Top bar with logo and summit name */
.card-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
}

.hmi-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.card-summit {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-align: right;
}

.card-header {
    background: linear-gradient(135deg, rgba(29, 98, 146, 0.08) 0%, rgba(29, 98, 146, 0.01) 100%);
    padding: 1.5rem 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.profile-photo-container {
    width: 180px;
    height: 180px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--card-bg);
    box-shadow: var(--shadow-md);
    background-color: var(--bg-color);
    flex-shrink: 0;
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-name {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.card-topic {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.speaker-card:not(.empty) .card-topic {
    color: var(--text-dark);
}

.card-body {
    padding: 1.25rem 2rem;
    flex: 1;
    overflow: hidden;
}

.card-bio {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-body);
}

.card-footer {
    padding: 0 2rem 1.5rem;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.decorative-line {
    height: 4px;
    width: 50px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

@media (max-width: 860px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }
    .form-section, .preview-section {
        max-width: 100%;
        width: 100%;
    }
    .app-container {
        padding: 2rem 1rem;
    }
    .speaker-card {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }
}
