:root {
    --color-primary: #1F4E79;
    --color-primary-dark: #163A5A;
    --color-secondary: #6B7280;
    --color-success: #16A34A;
    --color-success-bg: #DCFCE7;
    --color-error: #DC2626;
    --color-error-bg: #FEE2E2;
    --color-warning: #D97706;
    --color-warning-bg: #FEF3C7;
    --color-bg: #F3F4F6;
    --color-card: #FFFFFF;
    --color-text: #1F2937;
    --color-text-muted: #6B7280;
    --color-text-light: #9CA3AF;
    --color-border: #E5E7EB;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============ HEADER ============ */
header {
    background: var(--color-primary);
    color: white;
    padding: 14px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

.user-role {
    font-size: 11px;
    opacity: 0.85;
    line-height: 1.2;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:active {
    background: rgba(255, 255, 255, 0.3);
}

/* ============ MAIN ============ */
main {
    flex: 1;
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.screen {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hidden {
    display: none !important;
}

/* ============ CARDS ============ */
.card {
    background: var(--color-card);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
}

.card.center {
    text-align: center;
}

.card h1, .card h2, .card h3 {
    margin-bottom: 8px;
    color: var(--color-text);
}

.card h1 { font-size: 22px; }
.card h2 { font-size: 19px; }
.card h3 { font-size: 16px; }

.card p {
    color: var(--color-text-muted);
    line-height: 1.5;
}

.subtitle {
    margin-bottom: 20px;
}

.muted {
    color: var(--color-text-muted);
}

.small {
    font-size: 12px;
}

/* ============ ICONS ============ */
.logo, .big-icon, .icon-large {
    font-size: 64px;
    margin-bottom: 12px;
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--color-success);
    color: white;
    border-radius: 50%;
    font-size: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.error-icon {
    width: 80px;
    height: 80px;
    background: var(--color-error);
    color: white;
    border-radius: 50%;
    font-size: 40px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

/* ============ BOTONES ============ */
button {
    font-family: inherit;
    cursor: pointer;
}

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    margin-top: 12px;
    transition: transform 0.1s, background 0.2s;
}

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

.btn-primary:active {
    background: var(--color-primary-dark);
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:active {
    background: var(--color-bg);
    transform: scale(0.98);
}

.btn-big {
    padding: 18px 20px;
    font-size: 18px;
    margin-top: 20px;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.actions .btn-primary,
.actions .btn-secondary {
    margin-top: 0;
    flex: 1;
}

/* ============ FORM ============ */
.label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
}

.select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-size: 16px;
    background: white;
    color: var(--color-text);
}

/* ============ PREVIEW ============ */
.preview-wrapper {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    text-align: center;
    max-height: 400px;
}

.preview-wrapper img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid var(--color-border);
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ============ LISTAS ============ */
ul {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}

ul li {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--color-text-muted);
}

ul li:last-child {
    border-bottom: none;
}

ul li .check {
    color: var(--color-success);
    font-weight: bold;
}

/* ============ SPINNER ============ */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ MESSAGES ============ */
.error-msg {
    background: var(--color-error-bg);
    color: var(--color-error);
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 13px;
    text-align: left;
}

code {
    background: var(--color-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

pre {
    background: var(--color-bg);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 11px;
    margin-top: 8px;
    text-align: left;
}

/* ============ FOOTER ============ */
footer {
    text-align: center;
    padding: 16px;
    margin-top: auto;
}

/* ============ DESKTOP ============ */
@media (min-width: 600px) {
    main {
        padding: 24px 16px;
    }
    .card {
        padding: 28px;
    }
}
