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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #1a1a2e;
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 640px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #1a7a4a;
    border-radius: 50%;
}

.subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.4rem;
}

.textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
}

.textarea:focus {
    outline: none;
    border-color: #1a7a4a;
    box-shadow: 0 0 0 3px rgba(26, 122, 74, 0.1);
}

.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.3rem;
}

.select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.select:focus {
    outline: none;
    border-color: #1a7a4a;
    box-shadow: 0 0 0 3px rgba(26, 122, 74, 0.1);
}

.input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.input:focus {
    outline: none;
    border-color: #1a7a4a;
    box-shadow: 0 0 0 3px rgba(26, 122, 74, 0.1);
}

.code-input {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #1a7a4a;
    color: #fff;
}

.btn-primary:hover {
    background: #15643d;
}

.btn-outline {
    background: transparent;
    color: #1a7a4a;
    border: 2px solid #1a7a4a;
}

.btn-outline:hover {
    background: #f0faf4;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    background: #f0f0f0;
    color: #444;
    border-radius: 6px;
}

.btn-sm:hover {
    background: #e4e4e4;
}

.btn-full {
    width: 100%;
}

.loading {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    padding: 0.75rem;
}

.hidden {
    display: none !important;
}

.result-box {
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.result-success {
    background: #f0faf4;
    border: 2px solid #1a7a4a;
    text-align: center;
}

.code-display {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    color: #1a7a4a;
    margin-bottom: 0.5rem;
}

.expires-info {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.75rem;
}

.warning-text {
    font-size: 0.8rem;
    color: #888;
}

.result-content {
    background: #fafafa;
    border: 1px solid #e0e0e0;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filename {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.85rem;
    color: #555;
    font-weight: 500;
}

.result-actions {
    display: flex;
    gap: 0.4rem;
}

.content-preview {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 0.75rem;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.825rem;
    line-height: 1.5;
    max-height: 350px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.result-footer {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.75rem;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

.footer {
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    margin-top: 2rem;
    padding-bottom: 1rem;
}

/* ===== QR y resultado de guardado ===== */
.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1rem 0;
}

#qr-container {
    display: flex;
    justify-content: center;
}

.qr-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

.separator {
    border: none;
    border-top: 1px solid #d0e4d8;
    margin: 1rem 0;
}

.manual-hint {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.code-repeat {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5em;
    color: #1a7a4a;
}

.privacy-notice {
    font-size: 0.78rem;
    color: #888;
    text-align: center;
    margin-top: 1rem;
    line-height: 1.4;
}

/* ===== Hint de código en recuperación ===== */
.code-hint {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin-top: 0.75rem;
}

.code-hint strong {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    letter-spacing: 0.2em;
    color: #1a7a4a;
}

@media (max-width: 480px) {
    body {
        padding: 1rem 0.75rem;
    }
    .card {
        padding: 1rem;
    }
    .code-display {
        font-size: 1.6rem;
        letter-spacing: 0.25em;
    }
}
