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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #003366 0%, #004d99 100%);
    color: white;
    margin: -20px -20px 30px -20px;
    border-radius: 0 0 10px 10px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

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

.form-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.form-section h2 {
    color: #003366;
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #004d99;
    box-shadow: 0 0 0 3px rgba(0,77,153,0.1);
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.form-group input[type="file"] {
    padding: 10px 0;
}

/* Toolbar Styles */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.toolbar-label {
    font-weight: 600;
    color: #555;
    min-width: 100px;
    font-size: 0.9rem;
}

.char-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s;
}

.char-btn:hover {
    background: #003366;
    color: white;
    border-color: #003366;
}

.char-copied {
    display: none;
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
    max-width: 150px;
}

.char-copied.show {
    display: block;
    animation: fadeOut 1.5s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #003366 0%, #004d99 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,51,102,0.3);
}

.btn-primary:disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
}

.btn-download {
    display: inline-block;
    background: #28a745;
    color: white;
    text-decoration: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-download:hover {
    background: #218838;
}

.btn-secondary {
    background: white;
    color: #003366;
    border: 2px solid #003366;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 15px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #003366;
    color: white;
}

/* Status and Download */
.status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    display: none;
}

.status.loading {
    display: block;
    background: #e3f2fd;
    color: #1565c0;
}

.status.error {
    display: block;
    background: #ffebee;
    color: #c62828;
}

.status.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
}

.submit-section {
    text-align: center;
}

.download-section {
    background: white;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.download-section h2 {
    color: #28a745;
    margin-bottom: 15px;
}

.download-section p {
    margin-bottom: 25px;
    color: #666;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .toolbar-label {
        min-width: 100%;
        margin-bottom: 5px;
    }
    
    .btn-secondary {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
}
