* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #FFFFFF 0%, #F5E6E6 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.app-container {
    max-width: 1400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    text-align: center;
    padding: 20px;
    background: #D80621;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

header::before {
    content: url('https://flagcdn.com/24x18/ca.png');
    position: absolute;
    top: 10px;
    left: 10px;
}

header::after {
    content: url('https://flagcdn.com/24x18/ca.png');
    position: absolute;
    top: 10px;
    right: 10px;
}

.logo {
    max-width: 200px;
    margin-bottom: 10px;
}

header h1 {
    font-size: 2rem;
    color: #FFFFFF;
    font-weight: 700;
}

.header-subtitle {
    font-size: 1rem;
    color: #FFFFFF;
    margin-top: 5px;
}

.header-link {
    color: #FFFFFF;
    text-decoration: none;
}

.header-link:hover {
    text-decoration: underline;
}

.welcome-text {
    text-align: center;
    padding: 20px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.welcome-text h2 {
    font-size: 1.5rem;
    color: #D80621;
    margin-bottom: 10px;
    font-weight: 600;
}

.welcome-text p {
    font-size: 1rem;
    color: #2c3e50;
    line-height: 1.5;
}

.container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-card, .preview-card {
    flex: 1;
    background: #FFFFFF;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    border: 1px solid #D80621;
}

h2 {
    font-size: 1.5rem;
    color: #D80621;
    margin-bottom: 15px;
    font-weight: 600;
}

h3 {
    font-size: 1.2rem;
    color: #D80621;
    margin: 20px 0 10px;
    font-weight: 600;
}

.accordion-item {
    margin-bottom: 10px;
}

.accordion-toggle {
    width: 100%;
    background: #F5E6E6;
    border: none;
    padding: 12px;
    text-align: left;
    font-size: 1rem;
    color: #D80621;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.3s;
}

.accordion-toggle:hover {
    background: #FFD1D1;
}

.accordion-content {
    padding: 10px 0;
    display: none;
}

.accordion-content.active {
    display: block;
}

label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 8px 0 4px;
    font-weight: 600;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #D80621;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #2c3e50;
    background: #FFFFFF;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    border-color: #A6051A;
    outline: none;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.toggle-group input[type="checkbox"] {
    width: auto;
}

.toggle-group label {
    flex: 0 0 auto;
    margin: 0;
}

.toggle-group input[type="text"],
.toggle-group input[type="url"],
.toggle-group input[type="email"] {
    flex: 1;
}

.accordion-content p a {
    color: #D80621;
    text-decoration: none;
}

.accordion-content p a:hover {
    text-decoration: underline;
}

button#copyButton {
    width: 100%;
    background: #D80621;
    color: #FFFFFF;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s;
}

button#copyButton:hover {
    background: #A6051A;
}

.template-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.template-grid {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 15px;
    padding: 10px 0;
    max-width: 100%;
}

.template-item {
    flex: 0 0 250px;
    border: 1px solid #D80621;
    padding: 15px;
    background: #FFFFFF;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, border 0.3s;
    overflow: hidden;
}

.template-item:hover {
    transform: translateY(-5px);
    border-color: #A6051A;
}

.template-item.selected {
    border: 2px solid #D80621;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carousel-prev, .carousel-next {
    background: #F5E6E6;
    border: none;
    padding: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: #D80621;
    transition: background 0.3s;
}

.carousel-prev:hover, .carousel-next:hover {
    background: #FFD1D1;
}

.signature-preview {
    border: 1px solid #D80621;
    padding: 15px;
    background: #FFFFFF;
    border-radius: 8px;
    font-size: 11pt;
    line-height: 1.38;
    margin-top: 10px;
    overflow: hidden;
    max-width: 400px;
}

.signature-preview img, .template-item img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.signature-preview a, .template-item a {
    text-decoration: none;
}

.social-placeholder {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin: 0 5px;
    vertical-align: middle;
}

.debug {
    color: #D80621;
    font-size: 0.8rem;
    margin-top: 10px;
}

footer {
    text-align: center;
    padding: 20px;
    background: #D80621;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

footer span {
    font-size: 0.9rem;
    color: #FFFFFF;
}

footer p {
    font-size: 0.9rem;
    color: #FFFFFF;
}

footer a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

.flag {
    vertical-align: middle;
    margin-left: 5px;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .template-grid {
        flex-direction: column;
        overflow-x: hidden;
        max-height: 300px;
    }
    .template-item {
        flex: 0 0 auto;
        width: 100%;
    }
    .footer-content {
        flex-direction: column;
        gap: 10px;
    }
}