/* Driver License Generator — Codepool demo styles.
   Shares the visual language of the MRZ generator demo. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 1rem;
}

/* App header */
.app-header {
    text-align: center;
    color: white;
    padding: 2rem 1rem 1rem;
    animation: fadeInDown 0.6s ease-out;
}

.app-header h1 {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-header p {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    opacity: 0.95;
    font-weight: 300;
}

/* Legal / safety banner */
.notice-banner {
    max-width: 1200px;
    margin: 0 auto 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-left: 5px solid #ea580c;
    color: #7c2d12;
    font-size: 0.9rem;
    line-height: 1.6;
    box-shadow: var(--shadow-md);
}

.notice-banner strong {
    color: #9a3412;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    animation: fadeInUp 0.6s ease-out;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.75rem;
}

.card-body p {
    margin-bottom: 0.9rem;
}

.card-body p:last-child {
    margin-bottom: 0;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: block;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: inherit;
    min-width: 0;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:hover {
    border-color: var(--secondary-color);
}

.form-control[readonly] {
    background: #f1f5f9;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
    appearance: none;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 170px;
    box-shadow: var(--shadow-sm);
    font-family: inherit;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}

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

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

/* Payload output */
.mrz-output {
    width: 100%;
    padding: 1.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    background: #f1f5f9;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    resize: vertical;
    min-height: 150px;
}

.mrz-output:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Canvas */
.canvas-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    overflow-x: auto;
}

.canvas-wrapper canvas {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    background: white;
}

/* Hints */
.hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    line-height: 1.6;
}

.hint code {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.85em;
}

.hint a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Footer */
.app-footer {
    text-align: center;
    color: white;
    padding: 1.5rem 1rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.demo-footer {
    max-width: 900px;
    margin: 1rem auto 2rem;
    text-align: center;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.8;
}

.demo-footer a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.demo-footer a:hover {
    text-decoration: none;
}

.demo-footer .demo-footer-cta {
    display: inline-block;
    margin-left: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.18);
    text-decoration: none;
}

.demo-footer .demo-footer-cta:hover {
    background: rgba(255, 255, 255, 0.32);
    text-decoration: none;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .app-header {
        padding: 1.25rem 0.5rem 0.75rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .form-group[style*="span 2"] {
        grid-column: auto !important;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .canvas-wrapper {
        padding: 0.75rem;
    }

    .notice-banner {
        font-size: 0.82rem;
        padding: 0.85rem 1rem;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.5rem;
    }

    .card-header h2 {
        font-size: 1.15rem;
    }

    .card-body {
        padding: 1rem;
    }

    .form-control {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-width: 0;
    }

    .mrz-output {
        font-size: 0.78rem;
        padding: 0.9rem;
    }

    .demo-footer .demo-footer-cta {
        display: block;
        width: fit-content;
        margin: 10px auto 0;
    }
}

/* Print */
@media print {

    body,
    .notice-banner {
        background: white;
    }

    .app-header,
    .app-footer,
    .demo-footer,
    .button-group,
    .notice-banner {
        display: none;
    }

    .card {
        box-shadow: none;
        page-break-inside: avoid;
    }
}
