/* ===========================
   Global Styles - Globalia Corporate
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #071B3D;
    --secondary-color: #BFCDE0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --text-dark: #111827;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
}

body {
    font-family: 'Red Hat Display', 'Helvetica Neue', Arial, sans-serif;
    background: #000000;
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--white);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    min-height: 100vh;
}

/* ===========================
   Header with Banner
   =========================== */
.header {
    background: var(--primary-color);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.header-banner {
    width: 100%;
    height: auto;
    display: block;
}

.header-content {
    padding: 1.5rem 2rem 1rem;
    text-align: center;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.9;
    font-style: italic;
    margin-bottom: 1.5rem;
}

/* ===========================
   Section Styles
   =========================== */
.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--info-color);
}

/* ===========================
   Tab Selector
   =========================== */
.tab-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    max-width: 280px;
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    border-color: white;
}

/* ===========================
   Generator Section - Two Columns
   =========================== */
.generator-section {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.form-section {
    background: white;
}

.preview-section-wrapper {
    background: white;
}

#signatureForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.checkbox-group {
    grid-column: 1 / -1;
}

.btn-primary {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.required {
    color: var(--danger-color);
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--white);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(7, 27, 61, 0.1);
}

input.error {
    border-color: var(--danger-color);
}

input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    display: block;
    color: var(--danger-color);
    font-size: 0.75rem;
    margin-top: 0.3rem;
    min-height: 1rem;
}

/* ===========================
   Checkbox
   =========================== */
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 400;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(7, 27, 61, 0.3);
}

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

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: #0a2454;
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-info {
    background: var(--info-color);
    color: var(--white);
}

.btn-info:hover:not(:disabled) {
    background: #2563eb;
}

/* ===========================
   Preview Section
   =========================== */
.preview-section {
    display: none;
}

.preview-section.active {
    display: block;
}

.preview-container {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

#previewFrame {
    width: 100%;
    height: 350px;
    border: none;
    display: block;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.action-buttons .btn {
    flex: 1;
    min-width: 160px;
}

/* ===========================
   Alerts
   =========================== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
    font-size: 0.9rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert i {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

/* ===========================
   Footer
   =========================== */
.footer {
    padding: 1rem;
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    font-size: 0.85rem;
    grid-column: 1 / -1;
}

.footer i {
    margin-right: 0.5rem;
    color: var(--success-color);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1200px) {
    .generator-section {
        grid-template-columns: 1fr;
        max-height: none;
    }
    
    #signatureForm {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
    }

    .title {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .tab-selector {
        flex-direction: column;
        padding: 0 1rem 1rem;
    }

    .tab-btn {
        max-width: 100%;
    }

    .generator-section {
        padding: 1rem;
        gap: 1rem;
    }

    #signatureForm {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
        min-width: auto;
    }

    #previewFrame {
        height: 300px;
    }
}

/* ===========================
   Accessibility
   =========================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}
